I am getting the following error
Exception in thread "main" java.lang.NoClassDefFoundError: org/jsoup/Jsoup at Main.main(Main.java:42) Caused by: java.lang.ClassNotFoundException: org.jsoup.Jsoup 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.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 1 more Now what I have done so far:
I created a libs folder in my project folder and added the Jsoup.jar there. Then in eclipse I click properties, add external Jar and added it. I see the referenced library.
But the issue still persist. I dont get compilation errors. So this is a runtime issue. Appreciate the help.
Edit: I have found the following If I compile using
javac -classpath /path/to/jsoup.jar myclass.java and then
java -classpath /path/to/jsoup.jar myclass It runs perfect. Now. This is not working for me because I am going to use my application on a computer that does not have Jsoup. So how to I resolve this runtime issue?