5

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?

1
  • 1
    @nullpointer It seems that newest version of launch4j and not specifying the maximum version of jre solved the problem, I just want to wait for the client to test it on his machine. Commented Jan 2, 2019 at 15:16

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Was about to share the same here launch4j.sourceforge.net/changelog.html. It's worth highlighting the change Ticket #177 Launching on Java 9 JDK and newer is now possible (not just JRE) in the answer.
Latest Launch4j and not specifying the maximum jre version solved the problem.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.