JSON with JAVA – Introduction to JSON – Part2

JAVA SE does not have any internal package for processing JSON data. We have to import an external library. There are many libraries available. You can choose any. I will use Json-simple1.1 here. This makes our first step, importing the lib. Importing the lib Click here and download the zip file containing the jar library and follow the following steps to import it into eclipse. 1. Extract the zip file. 2. Right Click on the project folder in the package explorer, hover over Build Path and click on Configure Build Path. 3. You will see a nice window. Go to the Libraries tab and click on Add External JARs. 4. Navigate to the extracted jar folder, select the library and press open/ok. 5. Press ok again and you are done. Exploring the lib The library contains parser and data structures to process the given JSON formatted string. The parser parses the JSON data from string/Reader to its own readable form. The data structures consist of JSONObject and JSONArray Cla