Oscar
Oscar

Reputation: 855

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. :)

Upvotes: 6

Views: 73698

Answers (3)

Bao Pham
Bao Pham

Reputation: 637

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

Upvotes: 18

Saibo-creator
Saibo-creator

Reputation: 2201

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.

Upvotes: 2

Mubarak Tahir
Mubarak Tahir

Reputation: 207

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.

Upvotes: 2

Related Questions