I went to eclipse>export>java>runnable jar file
I changed launch configuration to my project name; destination: desktop.
I tried all three library handling options:
- extract required folders into generated JAR
- Package required libraries into generated JAR
- copy required files into a sub-folder next to the generated JAR.
I did not check anything to do with "ANT scripts".
When I pressed "finish" in the export window, eclipse gave me a error: "Could not find main method from given launch configuration". After pressing the "finish" button in the eclipse export window, the next button was grayed out. It created a JAR file at the destination. When I tried to open it Mac's Jar Launcher (default)(13.5.0), it gave me the message:
The Java JAR file "filename.jar" could not be launched.
Check the Console for possible error messages.
I googled this and some people said to check the manifest.mf file. I extracted it, then: "META-INF>manifest.mf". I opened manifest.mf with textedit. Inside manifest.mf were the lines:
Manifest-Version: 1.0
Rsrc-Class-Path: ./ acm.jar
Class-Path: .
I am running Mac OSx 10.6.8 snow leopard. I have the latest java available for snow leopard (I think my java is the one just BEFORE java 7).
Also, I'm trying to export a project with:
- a .java file that contains all my code
- acm.jar
- java.policy.applet
- Scores.txt
My .java file contains a public void run() {}
and JFrames/JPanels. My .java file extends ConsoleProgram.