cannot resolve symbol jsonobject in intellij

huangapple go评论63阅读模式
英文:

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;
英文:

Cannot resolve image:

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

&lt;!-- https://mvnrepository.com/artifact/org.json/json --&gt;
		&lt;dependency&gt;
			&lt;groupId&gt;org.json&lt;/groupId&gt;
			&lt;artifactId&gt;json&lt;/artifactId&gt;
			&lt;version&gt;20190722&lt;/version&gt;
&lt;/dependency&gt;

答案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 &#39;org.json:json:20220924&#39;

huangapple
  • 本文由 发表于 2020年8月13日 17:21:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/63391981.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定