Ticket 232 describes a problem with interpreting the environment variable JAVA_TOOLS_OPTIONS. It describes how version 3.5 abnormally terminates if the variable's value is bounded by the apostrophe character. In 3.50, presently the latest version, using the apostrophe character works as a bounding character.
However, the obvious bounding character, the quote, is a problem. Perhaps, it was a problem in 3.5 but nobody properly tested that version.
At any rate, the launcher terminates without any fanfare. I can't tell from the lauch4j.log file if it launched the jvm and the jvm died or if it died after writing a seemingly normal log file.
But I do know that if I set JAVA_TOOLS_OPTIONS and run a hello world from a java 21 command line that the JVM has no problem printing the "Picked up ..." message whether. So the problem has to be somewhere in the launcher.
After my tests with jdk 23, I think there is a java for windows bug that manifests only when JNI_CreateJavaVM starts the JVM. I don't see a problem when the java command starts the JVM. I think the java command main is handling the bounding characters correctly.
I think a reasonable workaround for the bug is to strip bounding characters (if they're used) before calling JNI_CreateJavaVM in jnihead.c.
I also looked in the "git log -p" output that extends all the way back to 2006. I see no reference at all in the commits to JAVA_TOOL_OPTIONS being interrogated at all, which adds more credit to my theory that it's a java bug, not a launcher bug.
Last edit: Jeffrey Holt 2024-12-20