B4J Question Running jars under OpenJDK 11

Cableguy

Expert
Licensed User
Make it the other way around:
First line : options
Second line: parameters

Just to be in sync with the command line itself
 

Cableguy

Expert
Licensed User
I should have thought of this before :(. Version 4 now posted accepts command line arguments to pass to the the invoked jar. See the first post for details.
Can you please provide an example of a resulting Complete command generated by the Tool if all lines are used in the <myjar.args> file
 

techknight

Well-Known Member
Licensed User
Is there a technical reason why with JDK11 that we cant just simply click and run a JAR like we could in the past? without all these hacks?

Just curious what changed.
 

agraham

Expert
Licensed User
This is probably an incomplete answer and is Windows only but from my point of view -

Java 8 was installed by a 'proper' installer that set a Path environment variable and some registry entries to make java.exe the default for a .jar file. When invoked by double-clicking on a jar file Java 8 seemed to be able to find all its libraries by itself and load and run the jar.

JDK 11 is xcopy installed without an installer. I believe that it is intended by the powers that be that Java 11 jars are packaged for distribution with a copy of the Java run-time to ensure correct run-time versioning for that jar. You could set up your own Path and default program for jar files but java.exe and javaw.exe in JDK11 also need to be told where the libraries are so it is not that simple a solution. Hence my kludge to run a jar from my own exe to avoid the packaging hassle for utilities that might change from invocation to invocation.

If any one has a better/more complete answer I like to read the detailed reasoning behind this change.
 
Top