Getting java.lang.ClassNotFoundException: org.jsoup.Jsoup

I run my application on Google App Engine. All I have is a simple servlet that is trying to use Jsoup. However, when I run the application, I get java.lang.ClassNotFoundException: org.jsoup.Jsoup.

I use Eclipse, so I added the jsoup jar file in the Java Build Path -> Libraries

+3
source share
4 answers

You need to put the JSoup JAR file in the /WEB-INF/libwebapp folder . This folder is covered by default classpath for webapp. In addition, Eclipse will automatically place all libraries in a folder /WEB-INF/libin the project build path, you will not need to do this manually. Of course, I assume that the project was created as a Dynamic Web Project.

+9
source

Another way to add .jar - right-click on your project and select Properties → Java build path , go to the library , and then click Add ... outside the JAR . This will allow you to navigate to the path of the .jar file that you want to add.

+1
source

Also make sure your import import org.jsoup.Jsoup;is after importing an application such as import com.google.gwt.core.client.GWT;

Importing JSOUP before other imports led to errors for deploying the application at one point for me.

0
source

I had the same error now in my Android project. To fix this on Android, you need to create the lib folder and put the .jar file there.

0
source

Source: https://habr.com/ru/post/1776028/


All Articles