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 › org.json › json
Maven Repository: org.json » json
December 24, 2025 - There are a large number of JSON packages in Java. Perhaps someday the Java community will standardize on one. Until then, choose carefully. ... aar android apache api arm assets build build-system bundle client clojure cloud config cran data database eclipse example extension framework github gradle ...
Discussions

java - Gradle build - not able to import org.json - Stack Overflow
Have you reimported the gradle ... of the gradle tool window)? ... That worked! Thanks! ... Sign up to request clarification or add additional context in comments. ... that fixes the problem. You can find the latest vesrion here mvnrepository.com/artifact/org.json/json At the ... More on stackoverflow.com
🌐 stackoverflow.com
Import org.json:json as gradle dependency
Hi, I couldn’t expect this would become as difficult. I am trying to import org.json:json to be used inside my beans. Have tried many things in my build.gradle file, among others: compileClasspath( group: ‘org.json’, name: ‘json’, version: ‘20201115’ ) and implementation ... More on forum.jmix.io
🌐 forum.jmix.io
0
0
December 27, 2021
Unable to add Json Dependency in build.gradle
Hi. I added this line: compile group: ‘org.json’, name: ‘json’, version: ‘20180813’ in the dependency section of build.gradle but I get an error and I have looked everywhere online. I even talked to Jason on 2073 who was also confused. Error: > Could not resolve all files for ... More on chiefdelphi.com
🌐 chiefdelphi.com
0
0
June 20, 2018
android studio cannot resolve import org.json.JSONObject - Stack Overflow
When browsing the tree in Android ... -> org -> json" but I cannot add them to my project. I get a "cannot refractor, class is in a jar file" error. Is there something I have not tried yet to solve this issue? I feel I will run into this again as I try to use other external libraries. ... Let' hope you are using Android Studio and the libGdx gradle ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
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
🌐
Jmix
forum.jmix.io › support
Import org.json:json as gradle dependency - Support - Jmix
December 27, 2021 - Hi, I couldn’t expect this would become as difficult. I am trying to import org.json:json to be used inside my beans. Have tried many things in my build.gradle file, among others: compileClasspath( group: ‘org.json’, name: ‘json’, version: ‘20201115’ ) and implementation ...
🌐
Chief Delphi
chiefdelphi.com › technical › java
Unable to add Json Dependency in build.gradle - Java - Chief Delphi
June 20, 2018 - Dont add it to build.gradle Download the jar and put it in USER/wpilib/user/java/lib/json.jar it will compile.
🌐
Sourcecodeexamples
sourcecodeexamples.net › 2019 › 12 › json-simple-maven-dependency.html
json-simple maven dependency
December 3, 2019 - Copy below JSON.simple Gradle dependency and paste in your project build.gradle file: // https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1' https://repo1.maven.org/maven2/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar ·
🌐
Maven Repository
mvnrepository.com › artifact › org.json › json › 20090211
Maven Repository: org.json » json » 20090211
There are a large number of JSON packages in Java. Perhaps someday the Java community will standardize on one. Until then, choose carefully. ... aar amazon android apache api arm assets build build-system bundle client clojure cloud config cran data database eclipse example extension framework github gradle ...
Find elsewhere
🌐
Jar-Download
jar-download.com › home › com.googlecode.json-simple › json-simple › 1.1.1 › source code › jsonparser.java
org.json.simple.parser.JSONParser Maven / Gradle / Ivy
A simple Java toolkit for JSON · The newest version! Maven · Gradle · Ivy · SBT · /* * $Id: JSONParser.java,v 1.1 2006/04/15 14:10:48 platform Exp $ * Created on 2006-4-15 */ package org.json.simple.parser; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.json.simple.JSONArray; import org.json.simple.JSONObject; /** * Parser for JSON text.
🌐
Gradle
plugins.gradle.org › search
Gradle - Plugins
Generates JSON schemas from JVM types · Outputs resolved dependencies as JSON grouped by configuration
🌐
Android Developers
developer.android.com › api reference › org.json
org.json | API reference | Android Developers
Skip to main content · English · Deutsch · Español – América Latina · Français · Indonesia · Polski · Português – Brasil · Tiếng Việt · 中文 – 简体
🌐
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 · Maven · Gradle ·
Published   Mar 21, 2012
Version   1.1.1
🌐
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.googlecode.json-simple › json-simple › 1.1
Maven Repository: com.googlecode.json-simple » json-simple » 1.1
A simple Java toolkit for JSON · Note: There is a new version for this artifact · Maven · Gradle · SBT · Mill · Ivy · Grape · Leiningen · Buildr · Scope: compile · test · provided · runtime · Scope: compile · test · provided · runtime · Format: Groovy Long ·
🌐
Kotlinlang
slack-chats.kotlinlang.org › t › 8095474 › why-is-it-impossible-to-use-json-in-gradle-from-8-0-onwards-
Why Is it impossible to use json in Gradle from 8 0 onwards kotlinlang #gradle
Why Is it impossible to use json in Gradle from 8.0 onwards? I have some .kts scripts where I read some local files that are JSONs ... org.json.simple.*, so this isn’t particular to Gradle 8. My guess is that you used to have a Gradle plugin that had a dependency on org.json, but you haven’t applied the plugin, or the plugin has been updated to remove that dependency.
🌐
Attacomsian
attacomsian.com › blog › json-simple-read-write-json
How to read and write JSON using JSON.simple in Java
November 15, 2019 - For this, we have to either use the 3rd-party library like Dozer or manually build the object. Let us use the Dozer library by adding the following dependency to your Gradle's project build.gradle file:
🌐
Jar-Download
jar-download.com › home › com.googlecode.json-simple › json-simple › 1.1 › source code › jsonaware.java
org.json.simple.JSONAware Maven / Gradle / Ivy
A simple Java toolkit for JSON · There is a newer version: 1.1.1Show newest version · Maven · Gradle · Ivy · SBT · package org.json.simple; /** * Beans that support customized output of JSON text shall implement this interface. * @author FangYidong ·