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?

Usagi Miyamoto
  • 6,196
  • 1
  • 19
  • 33
wdc
  • 2,623
  • 1
  • 28
  • 41
  • 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. – wdc Jan 02 '19 at 15:16

1 Answers1

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.

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
  • 2
    Was about to share the same here http://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. – Naman Jan 02 '19 at 14:57
  • Latest Launch4j and not specifying the maximum jre version solved the problem. – wdc Jan 03 '19 at 15:06