Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

NoClassDefFoundError

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I'm so happy! And I wish to make this tiny ad happy too:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic