If you download the JSON jar specified, and list its contents (e.g. with jar tf), it does not contain the org.json.simple package.
So the problem is simply that you need another jar.
EDIT:
I don't know if this is the intent, but an educated guess: if you add this dependency to build.gradle:
compile 'com.googlecode.json-simple:json-simple:1.1.1'
and these imports:
import org.json.simple.parser.*;
// import org.json.simple.*;
import org.json.*;
then the example compiles (for me).
Answer from Michael Easter on Stack OverflowVideos
If you download the JSON jar specified, and list its contents (e.g. with jar tf), it does not contain the org.json.simple package.
So the problem is simply that you need another jar.
EDIT:
I don't know if this is the intent, but an educated guess: if you add this dependency to build.gradle:
compile 'com.googlecode.json-simple:json-simple:1.1.1'
and these imports:
import org.json.simple.parser.*;
// import org.json.simple.*;
import org.json.*;
then the example compiles (for me).
Adding this to my build.gradle file works:
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
Probably your simple json.jar file isn't in your classpath.
I was facing same issue in my Spring Integration project. I added below JSON dependencies in pom.xml file. It works for me.
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
A list of versions can be found here: https://mvnrepository.com/artifact/org.json/json