I have a weird issue with eclipse,
I get ClassNotFoundException when trying to run a very basic example of jsoup 1.10.3
This is the code that I an trying out:
String html = "<p>An <a href='http://example.com/'><b>example</b></a> link.</p>";
Document doc = Jsoup.parse(html); // exception here
this is the exception:
Caused by: java.lang.ClassNotFoundException: org.jsoup.Jsoup
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
As far as eclipse - I added the JSoup jar (right click add to build path)
I have no compilation issues, I can actually see the autocomplete for the jsoup members and functions.
in the eclipse .classpath file i can see that the JSoup jar is there,
here is the file content:
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/javax.mail-1.6.0.jar"/>
<classpathentry kind="lib" path="lib/jsoup-1.10.3.jar"/>
<classpathentry kind="output" path="bin"/>
What I tried until now:
eclipse->clean
eclipse->delete project and recreate
eclipse->restart eclipse
eclipse Project ->lower the compiler version from 1.8 to 1.7, 1.6,1.5
researched dependencies, according to the Jsoup site:
Dependencies
jsoup is entirely self contained and has no dependencies.
I found many similar posts in stackoverflow all pointing to class path issue, but this case is different.
search git for similar issues: https://github.com/jhy/jsoup/issues?utf8=%E2%9C%93&q=ClassNotFoundException nothing helps
Is it possible that there is a static initialization in the Jsoup class for other class missing that is causing this odd issue?