Passing "-Dnashorn.args=" to OpenJDK 11 Fails
Closed this issue · 1 comments
Original report by me.
I suspect this might be a Java bug with "libjli.dylib" as opposed to appbundler, but I will start here. In Java 11, Oracle have deprecated the Nashorn Scripting Engine, which prints a warning every time you use it. You are able to suppress this warning by passing '-Dnashorn.args="--no-deprecation-warning"' as a JVM Option.
This works fine when specifying this option on the Java command line if I use "java -jar xx etc", but it doesn't suppress the warning when passing this via "appbundler" using the JVMOptions key within my Info.plist file:
<key>JVMOptions</key>
<array>
<string>-Dnashorn.args="--no-deprecation-warning"</string>
</array>
I have run appbundler with the JVMDebug key set to "true" and I can see it picks up this option and passes it as a command line option - I assume this is passed to "libjli.dylib" as opposed to "java"? I have even recompiled appbundler so it passes it as "Arg 1" by manually adding it to the "systemArguments":
int launch(char *, int, char **) Arg 1: '-Dnashorn.args="--no-deprecation-warning"'
Any pointers as to where this issue might lie would be appreciated. I have been successfully bundling my app with OpenJDK 10.0.2 using appbunder, but I was trying to migrate to OpenJDK 11.0.0 and come across this issue.
It looks like neither and more of a user error - if I omit the double speech marks around "--no-deprecation-warning" then it now works as expected, e.g:
<string>-Dnashorn.args=--no-deprecation-warning</string>