【发布时间】:2019-05-08 22:15:40
【问题描述】:
这里是 Java 开发的新手。我在eclipse中使用gradle。
我想导入 JSONParser。在我的代码中,我有:
import org.json.simple.parser.JSONParser;
在 build.gradle 我有:
repositories {
mavenCentral()
}
dependencies {
compile 'com.googlecode.json-simple:json-simple:1.1.1'
}
但是,当我尝试构建时,我得到:
int/MainApp.java:7: error: cannot find symbol
import org.json.simple.parser;
^
symbol: class parser
location: package org.json.simple
1 error
这里发生了什么?我想我不明白 gradle 是如何工作的。
【问题讨论】:
-
你能改吗
compile group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'