Have you considered using Maven? for instance, if you wanted a JAR to pars JSON you could just include...

http://mvnrepository.com/artifact/org.codehaus.jackson/jackson-core-asl/1.9.6

<dependency>
    <groupId>org.codehaus.jackson</groupId>
    <artifactId>jackson-core-asl</artifactId>
    <version>1.9.6</version>
</dependency>

in a pom.xml, this will give you the jar for JSON.

Or better yet, use the org.json one...

http://mvnrepository.com/artifact/org.json/json

<dependency>
    <groupId>org.json</groupId>
    <artifactId>json</artifactId>
    <version>20090211</version>
</dependency>
Answer from David 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 groovy io ios javascript jvm kotlin library logging maven ...
🌐
Reddit
reddit.com › r/java › the curious case of json-java (org.json) and maven's dependency "hell"
r/java on Reddit: The curious case of JSON-Java (org.json) and Maven's dependency "hell"
July 19, 2025 -

Hi. I have a recurring maven(?) issue that I hope is not unique to me and has been solved by someone somewhere.

As JSON parser, I use JSON-Java (the one with package org.json), instead of more famous ones, as the DX and API feel more fit for most/all my projects.

However, from time to time, I reach a very dreadful situation, where the "version" of the JSON-Java library that is available to my code is "not" the one that I have declared in my pom.xml file. In once case, the copyright notice in the source that I could see by clicking the class name in VSCode was from 2010, with the painful difference to the modern version that all parsing methods threw checked exceptions. In another instance, the JSONArray class did not implement Iterable/Iterator where in modern versions it does.

This is likely a maven transitive dependency issue, but the reason it is so visible for this particular library, is because either many libraries already have their own dependency on it, or that it's interface has evolved quite significantly along the way. Likely both.

The solution "in the book" for this is apparently to do "mvn dependency:tree" and exclude JSON-Java explicitly from other dependencies that depend on it. But it doesn't work for me! In my dependency three, only the recent version that is in my own pom file is shown, whereas in code/IDE (VSCode + IntelliJ), I can only use the old version. My deployment involves building a fat Jar, so it happens there too.

Am I doing something wrong? Is there a proven way to make only a certain version of a dependency available to my code, regardless of other versions that may be present deeper in the class path? Does the order of dependencies in pom file matter? and how can I strictly control the versions of dependencies that appear in my fat jar, in case it is possible at all?

Many thanks

🌐
GitHub
github.com › stleary › JSON-java
GitHub - stleary/JSON-java: A reference implementation of a JSON package in Java. · GitHub
The org.json package can be built from the command line, Maven, and Gradle. The unit tests can be executed from Maven, Gradle, or individually in an IDE e.g.
Starred by 4.7K users
Forked by 2.6K users
Languages   Java
🌐
Maven Central
central.sonatype.com › artifact › org.json › json
org.json:json - Maven Central
</description> <url>https://gi... module org.json { exports org.json; } </moduleInfoSource> </module> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>3.3.0</version> ...
🌐
Jar-Download
jar-download.com › home › org.json
Download org.json JAR files with all dependencies
Download org.json JAR files ✓ With dependencies ✓ Documentation ✓ Source code
🌐
Maven Central
repo1.maven.org › maven2 › org › json › json › 20230227
Central Repository: org/json/json/20230227
org/json/json/20230227 · / json-20230227-javadoc.jar 2023-02-27 13:38 185665 json-20230227-javadoc.jar.asc 2023-02-27 13:38 659 json-20230227-javadoc.jar.md5 2023-02-27 13:38 32 json-20230227-javadoc.jar.sha1 2023-02-27 13:38 40 json-20230227-sources.jar 2023-02-27 13:38 70293 json-202302...
🌐
GitHub
github.com › eskatos › org.json-java
GitHub - eskatos/org.json-java: Maven build of Douglas Crockford JSON-Java sources for publishing.
August 7, 2019 - This project is a single pom.xml file directly using the org.json package source from Douglas Crockford repository via a git submodule.
Starred by 6 users
Forked by 5 users
Find elsewhere
🌐
Maven Central
central.sonatype.com › artifact › org.json › json › 20230227
org.json:json:20230227 - Maven Central - Sonatype
<dependency> <groupId>org.json...</version> <packaging>bundle</packaging> <name>JSON in Java</name> <description> JSON is a light-weight, language independent, data interchange format....
🌐
Maven Central Repository
search.maven.org › org.json › json › 20180813
Maven Central Repository Search
</comments> </license> </licenses> <developers> <developer> <name>Douglas Crockford</name> <email>douglas@crockford.com</email> </developer> </developers> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <dependency> <groupId>com.jayway.jsonpath</groupId> <artifactId>json-path</artifactId> <version>2.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito
🌐
Maven Repository
mvnrepository.com › artifact › org.json
Maven Repository: org.json
JSON framework based on org.json implementation (patched for ChargeBee). ... aar android apache api arm assets build build-system bundle client clojure cloud config cran data database eclipse example extension framework github gradle groovy io ios javascript jvm kotlin library logging maven mobile module npm osgi persistence plugin resources rlang sdk server service spring sql starter testing tools ui web webapp
🌐
Jar-Download
jar-download.com › home › org.json › json › 20180813 › source code › jsonobject.java
org.json.JSONObject Maven / Gradle / Ivy
org.json.JSONObject maven / gradle build tool code. The class is part of the package ➦ Group: org.json ➦ Artifact: json ➦ Version: 20180813
🌐
Maven Central
repo1.maven.org › maven2 › org › json › json › 20210307
Central Repository: org/json/json/20210307
org/json/json/20210307 · / json-20210307-javadoc.jar 2021-03-08 03:55 175322 json-20210307-javadoc.jar.asc 2021-03-08 03:55 473 json-20210307-javadoc.jar.asc.md5 2021-03-08 03:55 32 json-20210307-javadoc.jar.asc.sha1 2021-03-08 03:55 40 json-20210307-javadoc.jar.md5 2021-03-08 03:55 32 ...
🌐
SourceForge
json-lib.sourceforge.net
Maven - Json-lib::Welcome
JSON-lib is a java library for transforming beans, maps, collections, java arrays and XML to JSON and back again to beans and DynaBeans. It is based on the work by Douglas Crockford in http://www.json.org/java.
🌐
Coderanch
coderanch.com › t › 666886 › java › package-org-json-exist
package org.json does not exist [Solved] (Beginning Java forum at Coderanch)
June 20, 2018 - Here are some details: $ echo $CLASSPATH /usr/share/java $ ll /usr/share/java/json* -rw-r--r-- 1 root root 49176 Jun 12 22:31 /usr/share/java/json-20160212.jar $ jar tf /usr/share/java/json-20160212.jar META-INF/MANIFEST.MF META-INF/ META-INF/maven/ META-INF/maven/org.json/ META-INF/maven/org.json/json/ META-INF/maven/org.json/json/pom.properties META-INF/maven/org.json/json/pom.xml org/ org/json/ org/json/CDL.class org/json/Cookie.class org/json/CookieList.class org/json/HTTP.class org/json/HTTPTokener.class org/json/JSONArray.class org/json/JSONException.class org/json/JSONML.class org/json/
🌐
Maven Central
repo1.maven.org › maven2 › org › json › json › 20240303
Central Repository: org/json/json/20240303
org/json/json/20240303 · / json-20240303-javadoc.jar 2024-03-03 15:16 210036 json-20240303-javadoc.jar.asc 2024-03-03 15:16 228 json-20240303-javadoc.jar.md5 2024-03-03 15:16 32 json-20240303-javadoc.jar.sha1 2024-03-03 15:16 40 json-20240303-sources.jar 2024-03-03 15:16 77380 json-202403...
🌐
deps.dev
deps.dev › maven › org.json:json
org.json:json | Maven
December 24, 2025 - You need to enable JavaScript to run this app