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 OverflowHave 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>
I downloaded a jar from here: http://code.google.com/p/org-json-java/downloads/detail?name=org.json-20120521.jar&can=2&q=
As far as I can tell (in December 2013) ...
Douglas Crockford's master source repository for "json.org" is now on GitHub - https://github.com/douglascrockford/JSON-java. (The GIT history starts in 2010, and the latest change in "master" is a couple of weeks ago.)
Paul Merlin (aka "eskatos") has Mavenized the code: https://github.com/eskatos/org.json-java
Binary "org.json" JAR files are "regularly" built from Paul Merlin's tree and pushed to Maven Central. You can find them via the "here" link in Paul's README.md file; see the line above.
There are other older (pre-2010) binary releases of the "org.json" JAR file in Maven Central under various guises; review the search results for this link" http://mvnrepository.com/search.html?query=org.json.
The copyright dates in the "org.json" source code don't mean much. They clearly aren't updated when the code is updated. However, Douglas Crockford does update the @version javadoc tags, at least in some commits.
UPDATE (December 2016)
As of some time in 2015, Douglas Crockford has passed ownership of the Github repository to Sean Leary. The old Github URL for the project now redirects to https://github.com/stleary/JSON-java. The project continues to be relatively active.
See also: Where has json.org java library gone?
I would recommend using json-simple or one of the other JSON libraries for Java that have developed. This has features the JSON.org API lacks (and I think it will stay that way).
For instance, the json-simple version of JSONObject implements Map and JSONArray implements List. It also has other features, like a SAX-style API.
If using Maven, add this dependency to your pom.xml
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.0</version>
</dependency>
For Gradle, add this to your build.gradle
compile 'javax.json:javax.json-api:1.0'
Going to assume that you are not using Java 7 and thus need to add the JAR file directly to your project path:
Here's the link to the JAR
And where it came from: http://jsonp.java.net/
Download and add to your project build path.
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.