Javac classpath is not recognizing json-simple-1.1.1.jar file even when exact path provided


#1

Hi,

I am attempting to read/write JSON files into my Java application.

I am using the the import org.json.simple; command to pull in the package.

Even when it appears to be obvious that the .jar file is within the classpath, it appears to me that c9 is still not noticing the .jar file.

I consistantly get this error when attempting to compile:

~/workspace/src $ javac -cp .:/lib/json-simple-1.1.1.jar -d …/classes json/src/main/java/com/devjavasource/java8/json/*.java -Xlint:unchecked

json/src/main/java/com/devjavasource/java8/json/CustomerJsonRead.java:3: error: package org.json does not exist
import org.json.*;

I have java 8 and maven installed.

Am I still missing something, since javac is not recognizing the .jar file?


#2

Can you post a screenshot or output of your directory tree?

Also, are you sure Java doesn’t already have a library for working with JSON that you can import without requiring a JAR file?