Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error in creating JAR file

807589Oct 6 2008 — edited Nov 4 2008
I have created an application and I have used JCreator to compile and run it.
My next step is that I want to make my application as executable jar
I did the following:
1- I made a package name called transpackage and I have include it in each file
2- I have executed the command : jar cfm MyJar.jar Manifest.txt transpackage/*.class
3- Manifest.txt file contains the following line :
Main-Class: transpackage.JavaTrans and an empty line after it.
4- If I executed the follwing line to run the jar file:

java -jar MyJar.jar

I got the follwing error:

Exception in thread "main" java.lang.NoClassDefFoundError: transpackage/JavaTran
s com/sun/jdi/connect
Caused by: java.lang.ClassNotFoundException: transpackage.JavaTrans com.sun.jdi.
connect
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)

Please advise what the problem here is. I couldn't figure it out. Thanks for help
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2008
Added on Oct 6 2008
38 comments
817 views