This is the first time I have tried to create an executable jar file from Eclipse, and I am confused as to how to do so. I know that there is the option to export a java file as a "jar" and "executable jar", but I am not sure how to ensure that my libgdx libraries, assets, and HighScore.txt file are fully integrated and are working. Furthermore, like most packages my package has a myriad of classes - one of which is the main class. How do I export the jar files and instruct eclipse that this specific class is the main class. Here is an image of my file structure:

MainSimpleBike is my main class.
Using the default jar
You specify your main class during runtime, like:
java -jar MyJar.jar MainSimpleBike
You may also modify the manifest.txt by following the instruction here:
http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html
If you modify the manifest.txt, like:
Main-Class: com.me.mygdxgame.MainSimpleBike
To create a jar:
jar cfm MyJar.jar Manifest.txt com.me.mygdxgame/*.class
You can simply run:
java -jar MyJar.jar
Your main class will be picked up automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With