File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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.
I agree. Here's the link:
subject: Same old jar file problem
It's not a secret anymore!