Reputation: 43
I am trying to build JRE bundled exe file of my project that is a game some sort of with the help of this tutorial using launch4j
, it has created exe
file but whenever I run this file it gives 2 error messages:
- A JNI error has occurred please check you installation.
- Java exception has occurred (JVM Launcher).
P.S: My project contains extra JAR files that are (AbsoluteLayout, curvesapi-1.03, poi-3.15-beta1, poi-ooxml-schema-3.15-beta1, xmlbeans-2.6.0
) in lib
folder.
Upvotes: 3
Views: 2551
Reputation: 1
I know I'm late but in case someone comes here looking for the answer...
Consider packaging a single jar file with all of your dependencies using maven-assembly-plugin for example, Here's a toturial.
How to Create an Executable JAR with Maven
Upvotes: 0
Reputation: 412
First of all export your project as single running .jar file which includes the .jar files themselves.
In Eclipse click right on your project -> "Export" -> "Runnable JAR file" -> "Package requred libraries into generated JAR". I don't know the exact way for other IDEs.
Can you execute this file? If yes convert the single .jar to a .exe via launch4j, otherwise check if your classpath is correct and if all libs are included.
In launch4j set your main class in the "classpath" tab, everything else is optional.
Upvotes: 0
Reputation: 9081
Just not worth the effort combining JARs to make a single exe.
If its mandatory that you need to do this, just build a wrapper class by importing all the JARs and ship that wrapper class out as a JAR then to exe
Upvotes: 0
Reputation: 1092
Upvotes: 2