[Htmlparser-user] ParserException error (newbie question)
Brought to you by:
derrickoswald
|
From: Andreas K. <lin...@gm...> - 2011-01-18 22:45:26
|
Hello all.
I have a newbie question that I hope you can help me with:
I'm using Ubuntu 10.04 and I have just installed the package
libhtmlparser-java. I get no errors when compiling the code below
(test_htmlparser.java) using the command
$ javac -classpath /usr/share/java/libhtmlparser.jar test_htmlparser.java
but when I try to run the program, I get the following error:
$ java test_htmlparser
Exception in thread "main" java.lang.NoClassDefFoundError:
org/htmlparser/util/ParserException
at test_htmlparser.main(test_htmlparser.java:12)
Caused by: java.lang.ClassNotFoundException:
org.htmlparser.util.ParserException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 1 more
What can I do to fix this?
/Andreas
----- test_htmlparser.java begin -----
import org.htmlparser.*;
import org.htmlparser.util.*;
class test_htmlparser
{
public static void main(String[] args)
{
try {
Parser parser = new Parser("http://www.sslug.dk");
} catch (ParserException e) {
System.err.println("Caught ParserException: " + e.getMessage());
}
}
}
----- test_htmlparser.java end -----
|