You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to set --add-opens=java.base/sun.nio.ch=ALL-UNNAMED for my application.
Actual behaviour
When I set javaOptions += "-J--add-opensss=java.base/sun.nio.ch=ALL-UNNAMED" it fails with Unrecognized option: -J--add-opensss=java.base/sun.nio.ch=ALL-UNNAMED during the tests.
Setting javaOptions += "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED" does not fail but app fails with java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Set sun.nio.ch.SelectorImpl.selectedKeys accessible: module java.base does not \"opens sun.nio.ch\" ....
So ut seems that --add-opens was not applied to jvm configuration.
Information
What sbt-native-packager are you using
1.9.16
What sbt version
1.9.6
What is your build system (e.g. Ubuntu, MacOS, Windows, Debian )
MacOS
What package are you building (e.g. docker, rpm, ...)
docker
What is your target system (e.g. Ubuntu 16.04, CentOS 7)
Linux Alpine
The text was updated successfully, but these errors were encountered:
I had trouble with this too. I tried all sorts of formatting for the strings with javaOptions and when it didn't throw formatting errors, it never seemed to use the java options I added.
I finally got it working by setting the JDK_JAVA_OPTIONS env variable in the project settings in build.sbt:
javaOptions +="--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"// fork tests in order to pick up javaOptions when running testsTest/ fork :=true// these will be added to conf/application.ini and picked up by the scriptUniversal/ javaOptions +="-J--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
Expected behaviour
I need to set
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
for my application.Actual behaviour
When I set
javaOptions += "-J--add-opensss=java.base/sun.nio.ch=ALL-UNNAMED"
it fails withUnrecognized option: -J--add-opensss=java.base/sun.nio.ch=ALL-UNNAMED
during the tests.Setting
javaOptions += "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
does not fail but app fails withjava.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Set sun.nio.ch.SelectorImpl.selectedKeys accessible: module java.base does not \"opens sun.nio.ch\" ....
So ut seems that
--add-opens
was not applied to jvm configuration.Information
1.9.16
1.9.6
MacOS
docker
Linux Alpine
The text was updated successfully, but these errors were encountered: