Question

I've developped a game during a Game Jam and I'd like to create an executable to distribute it to the other team members.

The game uses the slick2d and lwjgl library. I've tried to use JExePack, but the .exe file I get isn't runnable, I get an error while launching it.

Even the jar file gets me errors.

I'm only able to launch the game on the IDE. When I launch it with the command line : java -jar "game.jar", it obviously tells me that there's missing libraries, even if I indicate the path to the lib folder.

Is there an easy way to create an executable ?

Thanks in advance.

Was it helpful?

Solution

I think using a jar was a good idea.

You need to add every required jar in the classpath one-by-one for the jar to run properly.

OTHER TIPS

Launch4J (http://launch4j.sourceforge.net/) is my favorite tool for that. You can just export an executable jar from your IDE and create an exe out of it. Creating an executable jar in Eclipse gives you the option to include all required libraries in it, which saves you from adding them manually when create the exe file. The minimal settings you need are:

  • Input (your executable jar)
  • Output (the .exe you want to create)
  • Minimum Java version (i.e. 1.6.0)

Thats it (as far as I remember)

If you want the exe you can use exe4j, it's a very useful tool, but i think using jars is better since you can run them on every platform. Anyway, when you export the jar, check on your ide's preferences if it automatically imports the libs. (for example, on eclipse you can pack the required libs into the exported jar)

You can use Luncher4j to create an exe file and convert the jar libraries to dll files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top