I have installed eclipse ide for EE developers and I am receiving an import error for
JavaScript
x
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?
Advertisement
Answer
If using Maven, add this dependency to your pom.xml
JavaScript
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>1.0</version>
</dependency>
For Gradle, add this to your build.gradle
JavaScript
compile 'javax.json:javax.json-api:1.0'