I am trying to write a program in Java using Maven in IntelliJ which calls an API using HttpURLConnection and parses the response using JSONArray and JSONObject. I have attempted to import the org.json JAR file, and I've updated my pom.xml to include it as a dependency, but I'm still getting the following error.
Test.java:1: error: package org.json does not exist import org.json.JSONArray; pom.xml:
<dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20210307</version> </dependency> I have also tried adding the downloaded JAR file to Project Structure > Modules > Dependencies but have had no luck. Is there something else I could be overlooking here?