2

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.

Ajeet Shah
  • 18,551
  • 8
  • 57
  • 87

4 Answers4

2
  1. Are you sure you want to convert your Java program to EXE? Is it worth the effort? What are you trying to achieve by doing so?
  2. Consider that you have to provide all environment to your program - as it uses many dependencies. The errors you get are indications of this.
  3. The movie you refer to can not be considered a complete guide. A better source for you to start will probably be this: Convert Java to EXE — Why, When, When Not and How
Artur Opalinski
  • 1,052
  • 7
  • 12
0

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

Vivek Kalyanarangan
  • 8,951
  • 1
  • 23
  • 42
0

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.

huellif
  • 414
  • 4
  • 12
  • here is the file that i want to convert them into jre Bundled exe , please take a look , please share the jre bundled exe with me, https://drive.google.com/file/d/0B3O8HS_mOjDNd0hFNER5TDhITms/view?usp=sharing – user3810361 May 24 '16 at 12:19
  • Hi mate, it doesn't work this way. You have to embedd the .jar files into your game.jar at first. Read here: http://stackoverflow.com/questions/19917960/launch4j-how-to-attach-dependent-jars-to-generated-exe – huellif May 24 '16 at 12:40
0

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