Question:
How to run a Java game (.jar file)?
anonymous
1970-01-01 00:00:00 UTC
How to run a Java game (.jar file)?
Three answers:
deonejuan
2013-01-07 06:36:41 UTC
I use NetBeans, similar to Eclipse. You have to designate the class that contains the main() and then Eclipse or NetBeans writes the ANT script that writes the Manifest file in the .jar. Something like:

jarname.MainFrame.main



You can use the .jar tool included in the JDK, but that is two files with 3 arguments using the command-line.
anonymous
2013-01-07 05:58:58 UTC
I think you haven't Set ENTRY POINT for jar (Main Class) Take a look:



http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html

http://dasha.ics.hawaii.edu/~johnson/613f99/modules/04/jar-files.html
AnalProgrammer
2013-01-07 06:39:30 UTC
You need a manifest file that is named

META-INF/MANIFEST.MF



This manifest must contain a line as follows

Main-Class: MyPackage.MyClass



Where MyPackage and MyClass are the packages and class that contain the main method.



Have fun.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...