Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Same old jar file problem

 
Ajit Kanada
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just include the jar files in your classpath.
 
Ajit Kanada
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic