Can't find org.json.JSONObject

Rohan Prabhu picture Rohan Prabhu · Feb 8, 2012 · Viewed 14.9k times · Source

I'm working on a Java project that uses the org.json.JSONObject package. However, whenever I use it in eclipse, it says that no such package was found. However, when I develop on android i.e. create a new Android project in eclipse, I can use it without doing anything (no add external JARs and stuff), so I'm pretty sure that the required JAR is on my machine.

However, searching for "org.json", "*json*jar", "json*jar" over my entire filesystem did not return anything.

Answer

Jacob Schoen picture Jacob Schoen · Feb 8, 2012

I do not develop for android, but it looks like that class is part of that SDK for Android. I am not sure if it is the exact same class or not, but json.org has a class with the same name and package here or you can pick a different one to use from the Java list here.