I have this project on Eclipse 3.7 (Indigo) and planning to build the *.jar.
I am to build the project by File > Export > Java.Runnable JAR File > Named the filename of the jar file > Finish.
An error always return to me when running the jar file.
Could not find the main class: [package nmame].[Class name of Main class (PSVM) is located].
Program will exit.
In addition, MySQL Connector 5.1 was included as Referenced Library for JDBC use.
How can I resolve and be able to build a jar file that is running as runned on Eclipse as Java Application?
Thanks in advance.
When you export the project try selecting the option :
This will create a lib folder containing the required dependency libraries ..
You have also to select a valid launch configuration for the program, to make sure that the MANIFEST file will be created with the MAin class attribute populated correctly .
When you run the generated jar you should run it with this command line (READ the MANIFEST.MF) :
or with Main class specified in the command line :