简体   繁体   中英

Can't create runnable LWJGL jar with JarSplice

I created a runnable JAR with Eclipse for a small SLick2D game. No matter what settings I tried, I always received some sort of error, whether it be UnsatisfiedLinkError, or some class not being found.

I tried JARSplice, but that didn't work either.

Can anyone give me the steps to creating a runnable jar out of an Eclipse project?

The first thing you need is to somehow include the native libraries. You'll find them in the .zip you download from the lwjgl site.

I can recommend using JarSplice to package them. Make sure that when you specify what class it is supposed to run you do not use the default package (This is bad practice anyway). Specify the whole package path (eg package1.package2.Main), and it should run.

Use the packaged JAR generated by eclipse as your "input" jar of jarSplice.

If you use your command prompt to try and run your .jar after jarsplicing it, or using the manifest method, or whatever, you would go to the directory your .jar is in and type

java -jar YourGameNameHere.jar

This will give you the errors on why it will not run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM