package org.json does not exist when importing org.json.JSONObject

In my case i was using maven build tool and got this error so had to add below dependency from here like below and error resolved.

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

Class org.json.JSONObject is available in json-20131018.jar. You need to download this jar and add this jar to your buildpath.

In order to add external jar to buildpath you can - right click on your project in eclipse - click build path -> configure build path - goto tab libraries - there you will find to add external JAR

This will allow you to include any external jar into your build path.