How to run a program for foreign on java 17 without --add-modules...

Mark Hammons markehammons at gmail.com
Tue Oct 25 14:53:35 UTC 2022


Hi all,

I've finally achieved a milestone I was fighting hard for in my library (
https://github.com/markehammons/slinc), support for multiple versions of
foreign with the same program. I have a runtime test configured on that
project that takes on its classpath the Slinc-j19 runtime and the Slinc-j17
runtime, chooses the correct implementation at runtime based on the host
jvm, and executes code the same (so far). The one fly in the ointment is
the command-line requirements for foreign on java 17.
"--add-modules=jdk.incubator.foreign" won't work on java 19 for obvious
reasons, but I can't find a way to get the jvm to ignore the missing
module, nor can I find a way to get java 17 foreign to work without that
command line option. Do you all have any solution?

The main draw for this is to make it very easy for library or application
devs to write one version of their project and not have to select the
correct set of jvm command line options in order to get their project
working.

Thanks,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20221025/6b9cd5e3/attachment.htm>


More information about the panama-dev mailing list