It's not a secret anymore!*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Same old jar file problem" Watch "Same old jar file problem" New topic
Author

Same old jar file problem

Ajit Kanada
Ranch Hand

Joined: Jan 23, 2001
Posts: 95
Hi
I succesfully created jar file but i m not able to set path for my imported packages...like w3.org.dom 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


Thankx
Ajit
Cindy Glass
"The Hood"
Sheriff

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
Ajit
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.
Regards,
Amit
 
jQuery in Action, 2nd edition
 
subject: Same old jar file problem