stork icon indicating copy to clipboard operation
stork copied to clipboard

Add support for `--add-opens` JVM option

Open asm0dey opened this issue 4 years ago • 3 comments

Starting from JDK 9 we may need to add option --add-opens to the application, but if user has JDK 8 installed it won't launch because JDK 8 is not aware of such option.

asm0dey avatar Apr 02 '21 08:04 asm0dey

@asm0dey I would entertain any pull requests on this, although there isn't any support for conditional logic on JVM arguments supplied depending on the JVM that's going to execute at runtime. You can easily supply this as a hard-coded JVM argument, but not conditionally. I think it'd be fairly interesting to support that concept if you were interested in possibly trying to implement it.

jjlauer avatar Apr 02 '21 20:04 jjlauer

Well, if I understand correctly we have a function to get a version of Java. If so — then before building final command we could add one more arg, which will be assigned in the if block

asm0dey avatar Apr 03 '21 10:04 asm0dey

Like

[ parseJavaMajorVersion ${getJavaVersion $java_bin} -ge 9 ] && JAVA_ADD_OPENS=openshere

asm0dey avatar Apr 03 '21 10:04 asm0dey