Lord Stiltskin Lord Stiltskin - 17 days ago 8
JSON Question

Java says package doesn't exist. But it's in classpath

First of all, Java noob. I'm trying to decode a JSON string. I got the package

json-20160810.jar
and copied it to
C:\Program Files\Java\jre1.8.0_112\lib\ext
but java says it doesn't exist. I tried changing CLASSPATH to the same path as well. I'm not using any IDE

I even tried copying it to
\Java\jre1.8.0_91\lib\ext
and
\Java\jdk1.8.0_112\bin

Answer

try the following command:

javac -classpath ".;home/path/json-20160810.jar" yourJavaFile.java