This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Same old jar file problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Same old jar file problem" Watch "Same old jar file problem" New topic

Same old jar file problem

Ajit Kanada
Ranch Hand

Joined: Jan 23, 2001
Posts: 95
I succesfully created jar file but i m not able to set path for my imported and others...It gives error that ClassDefNotFound..but same application works in my directory..i think u ppl got my problem
when i try to run my jar file it gives error but without jar it works fine
I tried to get the info from arcives of javaranch but cant find one

Thanx in advance

Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Just include the jar files in your classpath.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Ajit Kanada
Ranch Hand

Joined: Jan 23, 2001
Posts: 95
HI cindy
I tried with the classpath but still it gives error
Here is my manifest file
Manifest-Version: 1.0
Main-Class: MainFrame
Classpath: C:Trial\Ajit.jar
also i have set my classpath to my jar file ie Ajit.jar on my m/c
At the import stmt of one of my class it gives error ClassDefNotFound
Can u figureout the problem
Thanx for reply
Amit Agarwal
Ranch Hand

Joined: May 09, 2001
Posts: 92
Hi Ajit,
Try this:
In your classpath add all references of the jars you will be using, including your own jar file. Then simply execute your main class file.
Also, in your manifest you have written
Classpath: C:Trial\Ajit.jar
Maybe it requires it with forward slashes (/), also note a missing "\" before Trial.
It is sorta covered in the JavaRanch Style Guide.
subject: Same old jar file problem
Similar Threads
Cannot load applet
JAR resources in JNLP file are not signed by same certificate
Problems creating a jar
NoClassDefFoundError in Servlets
ClassFormat Error (Bad length)