英文:
cannot resolve symbol jsonobject in intellij
问题
I am getting the error cannot resolve symbol jsonobject in intellij, shown in the attached image:Cannot resolve image, when I press Alt + Enter it does not give me the option to import class.
import org.json.JSONObject;
英文:
I am getting the error cannot resolve symbol jsonobject in intellij, shown in the attached image:Cannot resolve image, when I press Alt + Enter it does not give me the option to import class.
import org.json.JSONObject;
答案1
得分: 6
请将以下内容添加到您的pom.xml文件中:
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>
英文:
Please add this in your pom.xml file
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
</dependency>
答案2
得分: 1
你是否通过Maven开发Java项目?如果是的话,Alexandros Kourtis分享的方法应该有效。如果你不使用Maven,请下载org.json库并在项目中引用它。
英文:
Are you developing Java project through maven. If so approach shared by Alexandros Kourtis should work. If you are not using Maven, download the org.json library and reference it in the project.
答案3
得分: 0
For Gradle developers add this to to your build.gradle dependencies:
implementation 'org.json:json:20220924'
英文:
For Gradle developers add this to to your build.gradle dependencies:
// https://mvnrepository.com/artifact/org.json/json
implementation 'org.json:json:20220924'
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论