I have made a java application using jdk 8 and then made an executable file from the jar.
Then I updated my system to java 11, and deleted all older java versions from my system, and when I run this app from exe file it can't run and takes me to web browser and asks me to download java 8. But if I run the jar using java -jar app.jar
it runs normally on java 11.
I've used launch4j to make an exe out of jar, and there is no possibility to pick java 11 as the newest version.
So how can I make this exe run on java 11?
The class files created by Java 8 are still executable in Java 11; however, there have been other changes in the Java runtime (library changes, etc.) that might require modification of the code. These modifications may be made in Java 8 and compiled with Java 8 making it compatible with the Java 11 runtime.
Unless you have compiled EXE with latest launch4j 3.12 you are most likely stuck on Java 8. Support for newer JDK was added in ticket #177 Launch4J doesn't accept Java 9 JDK.
The solution would be to recompile EXE with latest launch4j and hope it works with Java 11. Alternatively you could create a BAT file running java -jar app.jar
but that goes against the whole point of launch4j.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With