Search code examples
javajarswtexelaunch4j

Converting Java SWT app to .exe launch4 error


I have built a Java SWT application using Eclipse on a Windows 10 (64 bit) laptop. I am trying to convert it into a .exe file so anyone can run the application regardless of having java installed.

I have used Launch4J to convert my runnable .jar file to a .exe file and I am successfully able to run it on my laptop.

However, when I try to run it on any other laptop, the .exe file does not open/does nothing on a double click.

When I tried to run the original .jar file on a different laptop from command line this is the error I am getting: Jar file error

_ Other posts on here say to include JRE and libraries in the build path which I did but it did not fix the problem. Java Build Path

Does anyone know how to fix this and allow my application to run?


Solution

  • The message means the SWT code has been compiled with Java 11 (class file version 55) but you are trying to run it with Java 8 (class file version 52).

    You can't do this, you need at least Java 11 to run current versions of SWT (or any Eclipse code).

    If you must run with Java 8 the SWT for Eclipse 2020-06 (4.16) was the last to be compiled for Java 8. The archive site here has that build.