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 Overflow
🌐
Oracle
oracle.com › java › technical details
Java API for JSON Processing
JsonParser provides forward, read-only access to JSON data using the pull parsing programming model. In this model, the application code controls the thread and calls methods in the parser interface to move the parser forward or to obtain JSON data from the current state of the parser.
🌐
Medium
medium.com › @AlexanderObregon › javas-jsonparser-parse-method-explained-76b126f6110e
Java’s JsonParser.parse() Method Explained | Medium
October 13, 2024 - Learn how to use Java's JsonParser.parse() method for parsing JSON data, including examples, performance tips, and comparisons to modern alternatives.
🌐
Baeldung
baeldung.com › home › json › jackson › json in java
JSON in Java | Baeldung
May 11, 2024 - Learn how to start working with JSON data in Java.
🌐
Reddit
reddit.com › r/programming › openjdk talks about adding a json api to the java standard library
r/programming on Reddit: OpenJDK talks about adding a JSON API to the Java Standard Library
May 15, 2025 - The prototype implementation is available to view here -- https://github.com/openjdk/jdk-sandbox/tree/json/src/java.base/share/classes/java/util/json ... That’s honestly fine IMO. Leave it to library authors to abstract. I’m sure they’re not gonna ship databinding in the JDK anyways so most people will still need one. But JSON parsers are a huge attack vector.
Top answer
1 of 2
1

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.

2 of 2
1

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..!

🌐
Reddit
reddit.com › r/java › java gets a json api
r/java on Reddit: Java Gets a JSON API
July 17, 2025 -

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.

Top answer
1 of 5
248
Just wondering, why everything must be a video? For whatever reason every time someone posts news in Java subreddit, it's always a video. I'd rather have text. Oldest JEP I could find, still a candidate: https://openjdk.org/jeps/198 . So I'm saying that contrary to the title, java does NOT get a JSON api, for now. Even said in the video: there might be a new jep, or update to the original jep. For now, devs seem to have mixed feelings about the possible implementation.
2 of 5
33
Here's the email from Paul Sandoz that inspired the video https://mail.openjdk.org/pipermail/core-libs-dev/2025-May/145905.html I'm ambivalent about the proposal as it stands. It doesn't seem to offer enough value over the existing solutions, other than being "batteries included" in the platform. Using interfaces and private implementations rather than records/sealed types/pattern matching seems odd. I know deconstruction patterns will eventually simplify its use. It needs time to bake. How does it relate to the new serialization effort (surely json could be one of the external formats used in serialization)? What about the nullabity proposals interaction (if any)? I imagine it can be layered on top, but I'd have liked to see some way of converting a json string into a nested record structure, and visa versa an object structure to a JSON in string. Parsing would fail with an exception if fields are required (as expressed with a non-null marker in the record), or incorrect type. Update: on reflection I think the interface/private implementation rationale - to allow other (non JSON) representations - is classic Java over-engineering - trying to be all things to all people, but at the expense of clean simplicity. JSON is so ubiquitous, so central to many apps that there really is, IMO, a need for a simple JSON only solution. Take a JSON string and parse/deserialize to a nested record structure. Take a nested record structure and encode/serialize to be JSON conformant string.
🌐
C# Corner
c-sharpcorner.com › article › java-21-new-features-and-examples
Java 21: New Features and Examples
String name = jsonObject.getString("name"); // Print the person's name. System.out.println(name); ... The following code shows how to use the new XML API to parse an XML string. import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; // Create an XML string.
Find elsewhere
🌐
GitHub
github.com › stleary › JSON-java
GitHub - stleary/JSON-java: A reference implementation of a JSON package in Java. · GitHub
import org.json.JSONObject; public class Test { public static void main(String args[]){ JSONObject jo = new JSONObject("{ \"abc\" : \"def\" }"); System.out.println(jo); } }
Starred by 4.7K users
Forked by 2.6K users
Languages   Java
Top answer
1 of 16
962

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 to JSONArray
  • { … } represents an object, so library will parse it to JSONObject

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

2 of 16
714

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
🌐
GeeksforGeeks
geeksforgeeks.org › java › parse-json-java
How to parse JSON in Java - GeeksforGeeks
December 23, 2025 - import java.io.FileReader; import java.util.Iterator; import java.util.Map; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; public class JSONReadExample { public static void main(String[] args) throws Exception { Object obj = new JSONParser().parse(new FileReader("JSONExample.json")); JSONObject jo = (JSONObject) obj; String firstName = (String) jo.get("firstName"); String lastName = (String) jo.get("lastName"); long age = (long) jo.get("age"); System.out.println(firstName); System.out.println(lastName); System.out.println(age); Ma
🌐
DEV Community
dev.to › devmercy › how-can-one-parse-json-text-in-a-java-application-3430
How can one parse JSON text in a Java application? - DEV Community
January 21, 2025 - Here today we are emphasising How it can be used in JAVA? Parsing JSON text in a Java application can be done using libraries such as Jackson, Gson, or org.json.
🌐
Maven Repository
mvnrepository.com › artifact › org.json › json
Maven Repository: org.json » json
December 24, 2025 - JSON is a light-weight, language independent, data interchange format. See http://www.JSON.org/ The files in this package implement JSON encoders/decoders in Java. It also includes the capability to convert between JSON and XML, HTTP headers, Cookies, and CDL.
🌐
GitHub
github.com › javaparser › javaparser
GitHub - javaparser/javaparser: Java 1-25 Parser and Abstract Syntax Tree for Java with advanced analysis functionalities. · GitHub
<dependency> <groupId>com.github.javaparser</groupId> <artifactId>javaparser-core</artifactId> <version>3.28.0</version> </dependency> ... Since version 3.6.17 the AST can be serialized to JSON.
Starred by 6.1K users
Forked by 1.2K users
Languages   Java
🌐
SourceForge
sourceforge.net › projects › json-java.mirror
JSON-java download | SourceForge.net
December 24, 2025 - Download JSON-java for free. A reference implementation of a JSON package in Java. JSON is a light-weight language-independent data interchange format. The JSON-Java package is a reference implementation that demonstrates how to parse JSON documents ...
🌐
Answer Overflow
answeroverflow.com › m › 1330582551223468164
Week 109 — How can one parse JSON text in a Java application? - Java Community | Help. Code. Learn.
January 19, 2025 - Java itself does not include a way to parse JSON, although a person with enough knowledge can write their own parser. Still, parsing JSON in Java is easy, as there are many parser libraries available! This leads us to the first question: "which library should I use?"
🌐
Mkyong
mkyong.com › home › java › how to parse json string with jackson
How to parse JSON string with Jackson - Mkyong.com
April 23, 2024 - package com.mkyong.json.jackson; ... java.util.Map; public class ConvertJavaObjectToJsonExample { private static final ObjectMapper MAPPER = new ObjectMapper(); public static void main(String[] args) throws IOException { Staff ...
🌐
Oracle
docs.oracle.com › javame › 8.0 › api › json › api › com › oracle › json › JsonObject.html
JsonObject (JSON Documentation)
This is a convenience method for (JsonObject)get(name) to get the value. ... the object value to which the specified name is mapped, or null if this object contains no mapping for the name ... java.lang.ClassCastException - if the value to which the specified name is mapped is not assignable to JsonObject type
🌐
Medium
hkcodeblogs.medium.com › java-21-string-templates-dcc87f1a3ebb
Java 21 — String Templates
November 16, 2023 - Strings in Java are default to each function in Java. Many times we have a requirement where we need to compose messages i.e. Email Body or data structures i.e. JSON, XML · To achieve this we have to write a lot of verbose and unreliable code. String Templates provides a readable and reliable way to write code for these scenarios. I am adding JDK 21 related resources and sample codes in this git repo.