Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing JSON into an Netbeans project

I need to import JSON library into netbeans.

How can I do that?

I searched on internet and I found this article.

According to this article when I import

import org.json.simple.JSONArray;
import org.json.simple.JSONObject

that, it must be work. But unfortunately it didn't work. and I get an error:

Package doesnt exist

Thanks for your help.

like image 305
Mahmut EFE Avatar asked Dec 10 '12 13:12

Mahmut EFE


3 Answers

As the article says you need to add the simple-json library to your project:

http://code.google.com/p/json-simple/

like image 134
bidifx Avatar answered Sep 18 '22 14:09

bidifx


For this we have to add Class org.json.JSONObject which available in json-20131018.jar. We need to download this jar and add this jar to your buildpath.

for it in netbeans right click 'libraries' in the project list, then click add jar/folder.

like image 22
Navneet Kaushik Avatar answered Sep 18 '22 14:09

Navneet Kaushik


Download jar from here : https://code.google.com/archive/p/json-simple/downloads And then add it to your "libraries" in netbeans.

Added this answer, because other answer didn't provide the above link, which is the easiest to download jar from.

like image 37
Aman B. Avatar answered Sep 20 '22 14:09

Aman B.