Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.json.simple cannot be resolved

Tags:

java

json

I'm a total java newbie and I have this problem. I try to decode Json and in order to do that I want to import these packages:

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

"The import cannot be resolved"... are these packages unavailable anymore or do I have to do something else in order to make them work?

Thanx in advance.

like image 841
baron_bartek Avatar asked Oct 31 '12 09:10

baron_bartek


2 Answers

Probably your simple json.jar file isn't in your classpath.

like image 88
Arun Manivannan Avatar answered Oct 06 '22 21:10

Arun Manivannan


I was facing same issue in my Spring Integration project. I added below JSON dependencies in pom.xml file. It works for me.

<dependency>
  <groupId>org.json</groupId>
  <artifactId>json</artifactId>
  <version>20090211</version>
</dependency>

A list of versions can be found here: https://mvnrepository.com/artifact/org.json/json

like image 45
Pravin Mishra Avatar answered Oct 06 '22 20:10

Pravin Mishra