is there some magic to use JDK modules / incubator...
# getting-started
t
is there some magic to use JDK modules / incubator code from kotlin? I can write the code, and idea understands it, but I get
Unresolved reference
when building (either in idea, or gradle)
I'm passing
-Xjvm-enable-preview
to the kotlin compiler. But I think that just passes it though to the JVM compiler (maybe?)
it ended up needing a few things. Create java module and add depencies :
Copy code
module ForFuncTest.main {
    requires jdk.incubator.foreign;
    requires kotlin.stdlib;
}
and add
--add-modules=jdk.incubator.foreign
to both compiler and run-time vm args.
You also need to have java 18 as your version of java, as there seems to be no way to specific to gradle whatJDK it should be using.
then gradle works. Intellij is still broken. can't figure it out.