Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add JSON Package Reference; new to Java

I'm brand new to Java and have always been a c kind-of-guy. That being said, I'm trying to use the JSON libraries (packages? classes? Java terminology is so damn confusing!) and am having issues adding them as a reference.

These three imports cannot be resolved:

import org.json.simple.JSONArray;

import org.json.simple.JSONObject;

import org.json.simple.JSONValue;

I went to json.org and downloaded the Java libraries but I'm not sure what to do with them. I've tried to go into project properties and add an external class to no avail. I noticed the downloaded folder is full of .java files. What am I supposed to do with these?

Sorry to present such a noob question on here, but I'm stumped.

like image 268
Matt Avatar asked Apr 18 '11 05:04

Matt


1 Answers

  • Right click on the Eclipse project,
  • choose Properties
  • Select Java Build Path
  • Click the libraries tab
  • click add external jars
  • find the json jar(s) and add them.
like image 180
MeBigFatGuy Avatar answered Oct 16 '22 13:10

MeBigFatGuy