I have installed eclipse ide for EE developers and I am receiving an import error for
import javax.json.Json; import javax.json.JsonReader; etc.
I have right clicked on project folder -> clicked properties -> clicked Java build path -> add library -> JRE System Library,
but the dependencies that show up are already imported. How can I import the javax.json package?
The javax. json package provides an Object Model API to process JSON. The Object Model API is a high-level API that provides immutable object models for JSON object and array structures. These JSON structures can be represented as object models using JsonObject and JsonArray interfaces.
If using Maven, add this dependency to your pom.xml
<dependency> <groupId>javax.json</groupId> <artifactId>javax.json-api</artifactId> <version>1.0</version> </dependency>
For Gradle, add this to your build.gradle
compile 'javax.json:javax.json-api:1.0'
Going to assume that you are not using Java 7 and thus need to add the JAR file directly to your project path:
Here's the link to the JAR
And where it came from: http://jsonp.java.net/
Download and add to your project build path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With