java.lang.NoClassDefFoundError: org/json/JSONObject [duplicate] java.lang.NoClassDefFoundError: org/json/JSONObject [duplicate] json json

java.lang.NoClassDefFoundError: org/json/JSONObject [duplicate]


No.. It is not proper way. Refer the steps,

For Classpath reference: Right click on project in Eclipse -> Buildpath -> Configure Build path -> Java Build Path (left Pane) -> Libraries(Tab) -> Add External Jars -> Select your jar and select OK.

For Deployment Assembly: Right click on WAR in eclipse-> Buildpath -> Configure Build path -> Deployment Assembly (left Pane) -> Add -> External file system -> Add -> Select your jar -> Add -> Finish.

This is the proper way! Don't forget to remove environment variable. It is not required now.

Try this. Surely it will work. Try to use Maven, it will simplify you task.


Please add the following dependency http://mvnrepository.com/artifact/org.json/json/20080701

<dependency>   <groupId>org.json</groupId>   <artifactId>json</artifactId>   <version>20080701</version></dependency>


The Exception it self says it all java.lang.ClassNotFoundException: org.json.JSONObject

You have not added the necessary jar file which will be having org.json.JSONObject class to your classpath.

You can Download it From Here