Dear friends,
I created a JAR file from Eclipse
IDE. The classes in the JAR contains
applet and Swing code. The usual basic problem is happening when i double click the JAR file,
"Could not find the main class. Program will exit".
I also tried this command:
java -jar MyJar.jar.
Following error occurred:
Exception in
thread "main" java.lang.NoClassDefFoundError: com/test/MainClass
Following are the things i ensured:
(1) System's environment variable PATH has this value: C:\Program Files\Java\jdk1.5.0_12.
(2) I opened the MANIFEST.MF file and added the Main-Class and Class-Path attributes
(3) Entered a carriage return at the end of the MANIFEST.MF file.
(4) I also added the JRE path to the PATH environment variable.
But still the problem exists!!
Kindly provide your valuable help
Thanks,
Vijay