There is not.
You can use built-in Nashorn engine to evaluate Javascript in Java 8
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class JSONParsingTest {
private ScriptEngine engine;
@Before
public void initEngine() {
ScriptEngineManager sem = new ScriptEngineManager();
this.engine = sem.getEngineByName("javascript");
}
@Test
public void parseJson() throws IOException, ScriptException {
String json = new String(Files.readAllBytes(/*path*/);
String script = "Java.asJSONCompatible(" + json + ")";
Object result = this.engine.eval(script);
assertThat(result, instanceOf(Map.class));
Map contents = (Map) result;
contents.forEach((t, u) -> {
//key-value pairs
});
}
}
source : Converting JSON To Map With Java 8 Without Dependencies
Update : Nashorn has been removed from Java 15
Answer from Smile on Stack OverflowThere is not.
You can use built-in Nashorn engine to evaluate Javascript in Java 8
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class JSONParsingTest {
private ScriptEngine engine;
@Before
public void initEngine() {
ScriptEngineManager sem = new ScriptEngineManager();
this.engine = sem.getEngineByName("javascript");
}
@Test
public void parseJson() throws IOException, ScriptException {
String json = new String(Files.readAllBytes(/*path*/);
String script = "Java.asJSONCompatible(" + json + ")";
Object result = this.engine.eval(script);
assertThat(result, instanceOf(Map.class));
Map contents = (Map) result;
contents.forEach((t, u) -> {
//key-value pairs
});
}
}
source : Converting JSON To Map With Java 8 Without Dependencies
Update : Nashorn has been removed from Java 15
The Java API for JSON Processing provides portable APIs to parse, generate, transform, and query JSON.

Official Website Reference - https://www.oracle.com/technical-resources/articles/java/json.html
Videos
Right, there is a difference between Java EE and Java SE. JSON parsing is needed with enterprise applications nowadays. Oracle has a dependency you can download:
https://javaee.github.io/jsonp/
If you are using maven, you can just include this in your POM:
<!-- https://mvnrepository.com/artifact/javax.json/javax.json-api -->
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.1.4</version>
</dependency>
BUT, this has been superseded by the Jakarta EE package (ee4j):
(GitHub download) https://github.com/eclipse-ee4j/jsonp
(Maven download)
<!-- https://mvnrepository.com/artifact/jakarta.json/jakarta.json-api -->
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>1.1.6</version>
</dependency>
If you look at EE4J, you can see there are so many APIs you can download. Java SE would be so bloated with them by default. For a while, Oracle was just distributing these 'reference implementations' of Java EE packages as well along with various servers like Glassfish. There are so many ways to handle these protocols and formats like JSON, and on the job these may be mission-critical.
Yes they are available as a part of Java ME and EE and not in SE.
https://docs.oracle.com/javame/8.0/api/json/api/index.html?com/oracle/json/stream/JsonParser.html
https://docs.oracle.com/javaee/7/api/javax/json/stream/JsonParser.html
Try using Java ME or EE, you'll get that.
//Happy learning..!
Java considers itself a "batteries included" language and given JSON's ubiquity as a data exchange format, that means Java needs a JSON API. In this IJN episode we go over an OpenJDK email that kicks off the exploration into such an API.
The org.json library is easy to use.
Just remember (while casting or using methods like getJSONObject and getJSONArray) that in JSON notation
[ … ]represents an array, so library will parse it toJSONArray{ … }represents an object, so library will parse it toJSONObject
Example code below:
import org.json.*;
String jsonString = ... ; //assign your JSON String here
JSONObject obj = new JSONObject(jsonString);
String pageName = obj.getJSONObject("pageInfo").getString("pageName");
JSONArray arr = obj.getJSONArray("posts"); // notice that `"posts": [...]`
for (int i = 0; i < arr.length(); i++)
{
String post_id = arr.getJSONObject(i).getString("post_id");
......
}
You may find more examples from: Parse JSON in Java
Downloadable jar: http://mvnrepository.com/artifact/org.json/json
For the sake of the example lets assume you have a class Person with just a name.
private class Person {
public String name;
public Person(String name) {
this.name = name;
}
}
Jackson (Maven)
My personal favourite and probably the most widely used.
ObjectMapper mapper = new ObjectMapper();
// De-serialize to an object
Person user = mapper.readValue("{\"name\": \"John\"}", Person.class);
System.out.println(user.name); //John
// Read a single attribute
JsonNode nameNode = mapper.readTree("{\"name\": \"John\"}");
System.out.println(nameNode.get("name").asText());
Google GSON (Maven)
Gson g = new Gson();
// De-serialize to an object
Person person = g.fromJson("{\"name\": \"John\"}", Person.class);
System.out.println(person.name); //John
// Read a single attribute
JsonObject jsonObject = new JsonParser().parseString("{\"name\": \"John\"}").getAsJsonObject();
System.out.println(jsonObject.get("name").getAsString()); //John
Org.JSON (Maven)
This suggestion is listed here simply because it appears to be quite popular due to stackoverflow reference to it. I would not recommend using it as it is more a proof-of-concept project than an actual library.
JSONObject obj = new JSONObject("{\"name\": \"John\"}");
System.out.println(obj.getString("name")); //John
The two most popular and fully-featured Java JSON libraries according to Maven Repository are:
- GSON (2.4)
- Jackson (2.6)
and jars for both are accessible via Maven:
- Gson requires
gson-2.4.jar(group idcom.google.code.gson, artifact idgson - Jackson requires
jackson-databind-2.6.2.jar(group idcom.fasterxml.jackson.core, artifactjackson-databind), as well as 2 supporting jars (jackson-corefor streaming parser,jackson-annotationsfor annotation suport)
Jars that you listed are for other lesser commonly used packages (one for json-lib, http://json-lib.sourceforge.net/ is pretty old; other I don't even know what it is), so I would not recommend you use them.
The missing class in the NoClassDefFoundError is located in commons-lang.jar from apache.
It can be downloaded here.