I'm trying to run a JAR file and nothing happens? Any idea why? Did I maybe do the export wrongly?
Some guidelines would be very welcome!
I'm trying to run a JAR file and nothing happens? Any idea why? Did I maybe do the export wrongly?
Some guidelines would be very welcome!
Jar files can only be executed if they contain a META-INF/MANIFEST.MF that specifies the main class (entry point) into your application. Otherwise you have to specify the class manually on the command line.
e.g. it contains
Main-Class: com.mycompany.App
Then you can just say:
java -jar MyApp.jar
Normally you would create a manifest.txt containing this line and package it in your jar like so:
jar cfm MyApp.jar Manifest.txt com/mycompany/*.class
Java 6 also implements a parameter on the jar tool which will create/modify the entry point in an existing jar's MANIFEST.MF if you prefer.
jar cfe MyApp.jar com.mycompany.App com/mycompany/App.class
what does jar file contain ? – YoK 3
It's a game
Can you give more informations ? What did you do ? What is the exact result ? – Colin
I just designed the game and I wanna send it to some ppl, they just accept JAR-files
Try to run it from the command line, and see if you get any errors (java -jar thefile.jar) – Thilo
I did! but it doesnt do anything...
What are you trying to accomplish? Piskvor
I want to send it to some other ppl..so they can "playitback" :)
I sorted it!!
Thanks for yr brainstorming anyway! I wasn't adding the file with the visual-material (gif-files). I think I added in the code a try-catch that check if there is any available map if there's not it'll shut down.
Gracias gente!
F/