D:\pro>jar tvf test2.jar
0 Sat Mar 13 16:39:48 IST 2010 META-INF/
97 Sat Mar 13 16:39:48 IST 2010 META-INF/MANIFEST.MF
7044 Sat Mar 13 08:58:44 IST 2010 BasicJDBCDemo.class
8470 Sat Mar 13 08:58:44 IST 2010 Classifier.class
516 Sat Mar 13 08:58:44 IST 2010 ConnectDialog$1.class
543 Sat Mar 13 08:58:44 IST 2010 ConnectDialog$2.class
543 Sat Mar 13 08:58:44 IST 2010 ConnectDialog$3.class
4350 Sat Mar 13 08:58:44 IST 2010 ConnectDialog.class
3481 Sat Mar 13 08:58:44 IST 2010 Count.class
1377 Sat Mar 13 08:58:44 IST 2010 DataFileTable$1.class
954 Sat Mar 13 08:58:44 IST 2010 DataFileTable$2.class
954 Sat Mar 13 08:58:44 IST 2010 DataFileTable$3.class
591 Sat Mar 13 08:58:44 IST 2010 DataFileTable$4.class
8815 Sat Mar 13 08:58:44 IST 2010 DataFileTable.class
4141 Sat Mar 13 08:58:44 IST 2010 DataFileTableModel.class
900 Sat Mar 13 08:58:44 IST 2010 DownloadingDialog.class
479 Sat Mar 13 08:58:44 IST 2010 EmailClient$1.class
507 Sat Mar 13 08:58:44 IST 2010 EmailClient$10.class
507 Sat Mar 13 08:58:44 IST 2010 EmailClient$11.class
507 Sat Mar 13 08:58:44 IST 2010 EmailClient$12.class
506 Sat Mar 13 08:58:44 IST 2010 EmailClient$2.class
1296 Sun Feb 07 19:00:38 IST 2010 EmailClient$3$1.class
872 Sat Mar 13 08:58:44 IST 2010 EmailClient$3.class
1355 Sat Mar 13 08:58:44 IST 2010 EmailClient$4.class
984 Sat Mar 13 08:58:44 IST 2010 EmailClient$5.class
505 Sat Mar 13 08:58:44 IST 2010 EmailClient$6.class
1914 Sat Mar 13 08:58:44 IST 2010 EmailClient$7.class
553 Sat Mar 13 08:58:44 IST 2010 EmailClient$8.class
1259 Sat Mar 13 08:58:44 IST 2010 EmailClient$9.class
3355 Sat Mar 13 08:58:44 IST 2010 EmailClient$Checker.class
14459 Sat Mar 13 08:58:44 IST 2010 EmailClient.class
1993 Sat Mar 13 08:58:44 IST 2010 Learner.class
537 Sat Mar 13 08:58:44 IST 2010 MessageDialog$1.class
564 Sat Mar 13 08:58:44 IST 2010 MessageDialog$2.class
564 Sat Mar 13 08:58:44 IST 2010 MessageDialog$3.class
4696 Sat Mar 13 08:58:44 IST 2010 MessageDialog.class
2663 Sat Mar 13 08:58:44 IST 2010 MessagesTableModel.class
354 Thu Feb 25 07:25:44 IST 2010 WindowCloser.class
The javaw.exe program that runs JAR files is flawed. Any exception or error thrown from the main method is shown with that specific error message. Try running the JAR file from the command line:
- open a command window
- go to the folder where the JAR file is located (use "cd folder" to go into a folder)
- execute the following command: "java -jar test2.jar"
This will show you the exact stack trace of the error or exception instead of consuming it and showing a (too) generic error message.
D:\pro>java -jar test2.jar
Exception in thread "main" java.lang.NoClassDefFoundError: EmailClient
Caused by: java.lang.ClassNotFoundException: EmailClient
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: EmailClient . Program will exit.
gayathri murugesan
Ranch Hand
Joined: Dec 21, 2009
Posts: 32
posted
0
before making the jar file i compiled an d ran the program .it worked properly. but when i make the jar file i am getting this CLASSNOTFOUNDEXCEPTION.
please help..
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: cannot find main class.program will exit. error in jar file creation