I recently wrote a javafx application with external jar files (apache POI), the version of jdk is 10.0.2.
I built the javafx project with Intellij's builder. And after that I used the exe4j to convert the jar file to .exe. In this process, I added the jre to the project. And then, I used the Inno Setup to build up an installation file.
After I installed the application, the weird thing happened. On my computer (win 10 x64 running on VMFusion of Mac), the program can run. But on any other windows computer, it shows the error below: run time error on others windows computer
java.lang.ClassNotFoundException: EntranceWindow at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:81) at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
EntranceWindow is the name of javaFX main Application
If the description is not de/tailed enough, please inform me directly. Could anybody please help me?
exe4j does not convert JAR files to native code, it creates a native launcher. You have to distribute the JAR files in the same relative location.
If you want to distribute only a single file, exe4j has a "JAR in EXE" mode where the JAR files are included in the executable and unpacked at runtime, so you only have a single executable. You can enable that option in the exe4j wizard.