How can I create an executable (from a JAR) with the --enable-preview option in Launch4J?

29 Views Asked by At

I recently developpe an JavaFX application with the very new JDK-22.

I use Launche4J to create my executable.

After creating the JAR archive, I configure Lauch4J like I've already did with past application.

It wrapped well : Wrapped log from Lauch4J

But when I try do run the generated executable I am given this error :

Executing: E:\GitFinder\exe\GitFinder.exe
Error: LinkageError occurred while loading main class org.fsp.gitfinder.GitFinderApplication
    java.lang.UnsupportedClassVersionError: Preview features are not enabled for org/fsp/gitfinder/GitFinderApplication (class file version 66.65535). Try running with '--enable-preview'

To fix it I tried to put the --enable-preview option in :

  • Command line args in the Basic tab
  • JVM options in the JRE tab

But none of this solution work. I was not able to run the application.

0

There are 0 best solutions below