Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing JSON library into IntelliJ IDEA

could you give me some tips about how to import this JSON lib by Doulgas Crockford to my IntelliJ IDEA? Thanks in advance. :)

like image 513
Oscar Avatar asked Jan 08 '16 12:01

Oscar


People also ask

How do I import libraries into IntelliJ?

From the main menu, select File | Project Structure | Project Settings | Modules. Select the module for which you want to add a library and click Dependencies. button and select Library. In the dialog that opens, select a project or a global library that you want to add to the module.

How do I open JSON parse in IntelliJ?

Inside your IDE, select Preferences -> Plugins -> Browse Repositories.... Search for JSON Parser. Click the green Install Plugin button. Click Close and OK, then Restart your IDE.

Where is JSON file in IntelliJ?

IntelliJ IDEA comes with support for JSONPath expressions. You can open up a window to evaluate JSONPath expressions by going to Edit -> Find -> "Evaluate JSONPath Expression...". If a JSON file is open, it will use this file to evaluate the expression.


3 Answers

I assume that you have already downloaded the JSON library. If not, you can download it from here: Maven repo

Go to File -> Project Structure... Then click on the Library tab on the left-hand side. You can add or remove any libraries. enter image description here

like image 197
Bao Pham Avatar answered Oct 19 '22 09:10

Bao Pham


if you tried all the download links for the Json.jar and its probably not working you can check this link out

after the link loads, search in the table where you can find "file" at the right of it you will see different kinds of file types. Select jar and wait for it to download.

you can now add the downloaded json.jar file in your Intelij.

open your intelij IDE press CTRL + ALT + SHIFT + S

just by the left of the dialog select modules then from the tabs choose dependencies then hit the + choose JARs or Directories, a dialog is gonna pop up prompting you to select the file path or directory where you have your json.jar. in most cases the json.jar is located in the downloads folder for PC users since it was downloaded. So, select the directory that have your json.jar file, find the json.jar in the directory. Then, hit enter and apply then wait for it to sync.

like image 42
Mubarak Tahir Avatar answered Oct 19 '22 09:10

Mubarak Tahir


If you still can not compile, you may need to add implementation 'org.json:json:20171018' in your build.gradle file's dependencies. Worked for me.

like image 34
Rafael Avatar answered Oct 19 '22 09:10

Rafael