Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Exception in thread "main" java.lang.NoClassDefFoundError

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Thanked 0 Times in 0 Posts

    Default Exception in thread "main" java.lang.NoClassDefFoundError

    I am using jericho html parser. But when I compile my program, it doesn't have any problem. but when i run it, the following error msg is found:

    Exception in thread "main" java.lang.NoClassDefFoundError: htmlparser/jericho/Config$UnterminatedCharacterReferenceSettings
    at htmlparser.jericho.Config$CompatibilityMode.<clini t>(Unknown Source)
    at htmlparser.jericho.Config.<clinit>(Unknown Source)
    at htmlparser.jericho.LoggerFactory.getLoggerProvider (Unknown Source)
    at htmlparser.jericho.LoggerFactory.getLogger(Unknown Source)
    at htmlparser.jericho.Source.newLogger(Unknown Source)
    at htmlparser.jericho.TagType.getLogger(Unknown Source)
    at htmlparser.jericho.TagType.register(Unknown Source)
    at htmlparser.jericho.MicrosoftConditionalCommentTagT ypes.register(Unknown Source)
    at Test.main(Test.java:22)
    Caused by: java.lang.ClassNotFoundException: htmlparser.jericho.Config$UnterminatedCharacterRef erenceSettings
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:4 23)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56)
    ... 9 more

    How can this problem be solved?

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Eastern Florida
    Thanked 2,485 Times in 2,436 Posts

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    java.lang.NoClassDefFoundError: htmlparser/jericho/Config$UnterminatedCharacterReferenceSettings
    Where is the definition for the missing class? The java program can not find the class's definition on the classpath.
    Is the class file in a jar file that needs to be on the classpath?
    Look in the jar file using a zip utility to see if the missing class file is there.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 3
    Last Post: December 7th, 2011, 02:03 AM
  2. Exception in thread "main" java.lang.NoClassDefFoundError
    By Scarice in forum Java Theory & Questions
    Replies: 25
    Last Post: July 4th, 2011, 10:02 PM
  3. Replies: 6
    Last Post: November 12th, 2010, 04:40 AM
  4. Replies: 13
    Last Post: October 13th, 2010, 11:20 AM
  5. Replies: 1
    Last Post: October 25th, 2009, 11:54 AM