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 Overflow
🌐
Maven Repository
mvnrepository.com › artifact › com.googlecode.json-simple › json-simple
Maven Repository: com.googlecode.json-simple » json-simple
March 21, 2012 - Googlecode JSON Simple · JSON Libraries · JSON Schema Libraries · JSON-LD Libraries · JSON Query Libraries · JSON-RPC Libraries · Maven Plugins · Testing · Android Packages · Language Runtime · JVM Languages · Logging Frameworks · JSON Libraries · Java Specifications · Core Utilities · Mocking · Annotation Libraries · Web Assets · HTTP Clients · Logging Bridges · Dependency Injection ·
🌐
Stack Overflow
stackoverflow.com › questions › 72922608 › json-simple-dependency-issue
maven - Json Simple dependency Issue - Stack Overflow
(fixed a different issue for me) I tried requires com.json.simple; or requires com.googlecode.json.simple; but I get the cannot be resolved to a module error. Also my project is a javafx Application, that implements server socket networks (JSON exchage). Im at a complete los here on what to do... Thanks for your help. ... So after a lot of trial and error, i have finally fixed it. Instead of vs code I used IntelliJ and added the dependencies there.
🌐
DigitalOcean
digitalocean.com › community › tutorials › json-simple-example
json-simple example | DigitalOcean
August 4, 2022 - json-simple uses Map and List internally for JSON processing. We can use json-simple for parsing JSON data as well as writing JSON to file. One of the best feature of json-simple is that it has no dependency on any third party libraries.
🌐
Maven Central
central.sonatype.com › artifact › com.googlecode.json-simple › json-simple
Maven Central - com.googlecode.json-simple
pkg:maven/com.googlecode.json-simple/json-simple@Loading... ... <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> </dependency>
🌐
Cliftonlabs
cliftonlabs.github.io › json-simple
json-simple
Once you're ready to upgrade to 3.* all you need to do is replace import packages with com.github.cliftonlabs.json_simple and replace DeserializationException with JsonException and you'll be good to go. If you're using 3.1.1 and wish to upgrade to 4.0.0 simply update any calls to JsonException#getPosition() to expect a long instead of an int.
🌐
Maven Repository
mvnrepository.com › artifact › com.github.cliftonlabs › json-simple › 4.0.1
Maven Repository: com.github.cliftonlabs » json-simple » 4.0.1
March 12, 2022 - Dependency Injection · XML Processing · Concurrency Libraries · Web Frameworks · Android Platform · Code Generators · View All · Home » com.github.cliftonlabs » json-simple » 4.0.1 · Java 7+ toolkit to quickly develop RFC 4627 JSON compatible applications.
Published   Mar 12, 2022
Version   4.0.1
Find elsewhere
🌐
Sourcecodeexamples
sourcecodeexamples.net › 2019 › 12 › json-simple-maven-dependency.html
json-simple maven dependency
December 3, 2019 - <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple --> <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> </dependency> For more details about the proper version to use, check out the following Maven Central link.
🌐
Google Groups
groups.google.com › g › json-simple › c › 2xmvBWAtcM0
Issue 91 in json-simple: MAVEN, json-simple 1.1.1 depends on Junit
To work around, you can use exclusions in your project's POM: <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> <exclusions> <exclusion> <groupId>junit</groupId> <artifactId>junit</artifactId> </exclusion> <!-- maven note: must manually exclude all ancestors see http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html --> <exclusion> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-core</artifactId> </exclusion> </exclusions> </dependency>
🌐
Maven Repository
mvnrepository.com › artifact › com.googlecode.json-simple › json-simple › 1.1
Maven Repository: com.googlecode.json-simple » json-simple » 1.1
Dependency Injection · XML Processing · Web Frameworks · Android Platform · Concurrency Libraries · Defect Detection Metadata · Code Generators · Top Categories · Home » com.googlecode.json-simple » json-simple » 1.1 · A simple Java toolkit for JSON ·
🌐
Google Code
code.google.com › archive › p › json-simple
Google Code Archive - Long-term storage for Google Code Project Hosting.
Archive · Skip to content · The Google Code Archive requires JavaScript to be enabled in your browser · Google · About Google · Privacy · Terms
🌐
GitHub
github.com › fangyidong › json-simple › issues › 91
MAVEN, json-simple 1.1.1 depends on Junit · Issue #91 · fangyidong/json-simple
April 13, 2015 - MAVEN, json-simple 1.1.1 depends on Junit#91 · Copy link · Labels · Priority-MediumType-Defectauto-migrated · GoogleCodeExporter · opened · on Apr 13, 2015 · Issue body actions · What steps will reproduce the problem? On central maven repo, http://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple/1.1.1 json-simple pom reference junit in its dependencies.
Author   GoogleCodeExporter
🌐
Maven Repository
mvnrepository.com › artifact › com.googlecode.json-simple › json-simple › 1.1.1
Maven Repository: com.googlecode.json-simple » json-simple » 1.1.1
March 21, 2012 - HomePage http://code.google.com/p/json-simple/ 🔍 Inspect URL · DateMar 21, 2012 · Filespom (3 KB)bundle (23 KB)View All · RepositoriesCentralAlfrescoAzisaba PublicCarmCS ArcaneArtsGluuGluu OXIceCreamQAQKyligence PublicLiferay PublicLoohpJamesMulesoftSoftmotionsTerrestrisWSO2 PublicXceptance+13 more · Ranking · #7267in MvnRepository · #60in JSON Libraries · Vulnerabilities · Vulnerabilities from dependencies: CVE-2020-15250 ·
Published   Mar 21, 2012
Version   1.1.1
🌐
GitHub
github.com › RameshMF › java-json-processing-tutorial › wiki › JSON.simple-Maven-Dependency
JSON.simple Maven Dependency
November 30, 2019 - <!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple --> <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> </dependency>
Author   RameshMF
🌐
Jar-Download
jar-download.com › home › com.googlecode.json-simple › json-simple › 1.1.1 › source code
Download json-simple JAR 1.1.1 ➔ With all dependencies!
Artifact json-simple Group com.googlecode.json-simple Version 1.1.1 Organization not specified URL http://code.google.com/p/json-simple/ License The Apache Software License, Version 2.0 Dependencies amount 1 Dependencies junit, There are maybe transitive dependencies!
🌐
Jar-Download
jar-download.com › home › com.github.cliftonlabs › json-simple › 2.1.2 › source code › jsonobject.java
org.json.simple.JSONObject Maven / Gradle / Ivy
org.json.simple.JSONObject maven / gradle build tool code. The class is part of the package ➦ Group: com.github.cliftonlabs ➦ Artifact: json-simple ➦ Version: 2.1.2
🌐
GitHub
github.com › jolokia › jolokia › issues › 426
Update json-simple 1.1.1 to avoid Junit as dependency · Issue #426 · jolokia/jolokia
November 14, 2019 - I noticed on my java project that if I add org.jolokia:jolokia-core:jar:1.6.2 as dependency, then com.googlecode.json-simple:json-simple:jar:1.1.1 is added as dependency. So Jolokia rely on json-si...
Author   boly38
🌐
Github-wiki-see
github-wiki-see.page › m › RameshMF › java-json-processing-tutorial › wiki › JSON.simple-Maven-Dependency
JSON.simple Maven Dependency - RameshMF/java-json-processing-tutorial GitHub Wiki
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple --> <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> </dependency>