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?
Re: Exception in thread "main" java.lang.NoClassDefFoundError
Quote:
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.