• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError

 
budsy remo
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used a third party api htmlparser.jar and i have kept that jar file in jdk/jre/lib/ext . Then i wrote the following code in my .java file
import org.htmlparser.beans.*;
import org.htmlparser.util.ParserException;
//and much more imports

Now when i compiled the code it gave me no errors but when i tried to run the code it gave me NoClassDefFoundError . for that i checked out the .jar file and to the best of my knowledge it's ok . So why am i getting this error ?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am surprised that you dont get compilation error. hmmm, ok please have a look at this . this may help you
 
budsy remo
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw the tutorial and i know how to set the classpath as well but this hasn't solve the problem .
 
budsy remo
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's what i did in the command prompt
set classpath=D:\gagan\jdk1.6.0_22\jre\lib\ext;C:\Documents and Settings\g\Desktop\testspace

testspace is the directory where my .java file is kept and ext is the directory where my .jar file is kept .
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the class name reported by NoClassDefFoundError?

And we would like to have a look at the code as well. May be you could post a ssce
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic