--add-opens in INI file not correctly used by launcher? [message #1849680] |
Sat, 29 January 2022 02:08  |
Eclipse User |
|
|
|
I have been developing an RCP application and recently switched from Java 11 to Java 17. For backward compatibility, we temporarily need to open several modules to `ALL-UNNAMED`. All the corresponding `--add-opens` were added to the end of the INI file. The resulting INI file looked similar to the following:
-startup
plugins/org.eclipse.equinox.launcher_1.5.600.v20191014-2022.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1100.v20190907-0426
-vm
jdk17/bin
-data
@user.home/Documents/MyApp
-vmargs
-Djava.library.path=./javafx17-mod/bin
-Dorg.osgi.framework.bundle.parent=ext
-Defxclipse.java-modules.dir=./javafx17-mod/lib
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.nio.file=ALL-UNNAMED
Oddly, the plugins that required the module opening would not work and threw errors specifically with the message that the very modules included above where NOT opened.
After trying several variations of ordering of the `vmargs`, I wrote a BAT file (I'm on Windows 10) to launch the application without the native launcher:
.\jdk17\bin\java ^
-jar plugins/org.eclipse.equinox.launcher_1.5.600.v20191014-2022.jar
-Djava.library.path=./javafx17-mod/bin ^
-Dorg.osgi.framework.bundle.parent=ext ^
-Defxclipse.java-modules.dir=./javafx17-mod/lib ^
--add-opens java.base/java.io=ALL-UNNAMED ^
--add-opens java.base/java.util=ALL-UNNAMED ^
--add-opens java.base/java.nio.file=ALL-UNNAMED ^
At first, this didn't solve the problem. However, when I moved the `-jar` argument to the very end, everything worked!
Is there a way to modify the INI file so that it passes the startup jar argument last to the JVM so that the `--add-opens` works?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03400 seconds