0

I downloaded json-20200518.jar (from here: https://mvnrepository.com/artifact/org.json/json/20200518), and put it in my bin folder (the same folder where I have javac.exe) which is added to my PATH variable.

My client.java file has:

import org.json.simple.JSONObject;

In cmd, I run:

javac -cp json-20200518.jar client.java 

And I get this error:

client.java:3: error: package org.json.simple does not exist
import org.json.simple.JSONObject;

What do I have to do with the jar file to make it work?

Gimme the 411
  • 994
  • 9
  • 25

1 Answers1

1

In the specified maven jar file link, the package structure for JSONObject class is org.json.JSONObject.

Try to change the package name from org.json.simple.JSONObject to org.json.JSONObject and it will compile successfully.

Ansu
  • 76
  • 5