Download Json Simple Jar

0 views
Skip to first unread message

Argelia Fernandez

unread,
Jan 25, 2024, 10:53:22 AM1/25/24
to mamuszeane

After redesigning the library to be backwards compatible it was decided that support for java 2 to 6 would be dropped in favor of generics (thus a 2.* version) as it was the most avidly requested feature. The library was also written in the package org.json.simple so a maven artifact under the org.json.simple groupId made sense. Once all that work was done it was up to the merge with upstream to take over the rest. However, after many emails and external issues only the first part went according to plan. So, the project is now maintained by Clifton Labs and the maven artifacts are now published under the groupId 'com.github.cliftonlabs' (formerly 'com.googlecode.json-simple').

download json simple jar


Download Filehttps://t.co/ot35dAwmeq



If you've used a version before version 3.0.0 and do not wish to upgrade yet: use version 2.3.1 for the latest backwards compatible version to upgrade 1.* and 2.* code gradually to 3.* style code. 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.

json-simple uses Map and List internally for JSON processing. We can use json-simple for parsing JSON data as well as writing JSON to file. One of the best feature of json-simple is that it has no dependency on any third party libraries. json-simple is very lightweight API and serves well with simple JSON requirements.

Most important class in json-simple API is org.json.simple.JSONObject. We create instance of JSONObject and put key-value pairs into it. JSONObject toJSONString method returns the JSON in String format that we can write to file. For writing list to a JSON key, we can use org.json.simple.JSONArray.

For reading JSON from file, we have to use org.json.simple.parser.JSONParser class. JSONParser parse method returns JSONObject. Then we can retrieve values by passing key names. Below is json-simple example to read JSON from file.

Download the latest version of JSON.simple jar file from json-simple @ MVNRepository. At the time of writing this tutorial, we have downloaded json-simple-1.1.1.jar, and copied it into C:\>JSON folder.

Set the JSON_JAVA environment variable to point to the base directory location where JSON.simple jar is stored on your machine. Let's assuming we've stored json-simple-1.1.1.jar in the JSON folder.

The solution that I used in the end was to change to sourceforge.net json parser, a couple of code tweaks and my JUnit tests still worked and Tomcat did not complain. This may not be the best solution but it worked.

df19127ead
Reply all
Reply to author
Forward
0 new messages