从 Maven 导入 json-simple 失败

Import json-simple from Maven failed

我正在使用 JSON-Simple on this site 练习 Java JSON 编程,上面写着:

All the jars available in maven repo is supported.

更新:

所以我现在已经将外部 maven 库添加到项目中。

但我仍然无法正常工作。

我试过了

import com.googlecode.json-simple.JSONObject;

但得到了:

error: ';' expected
import com.googlecode.json-simple.JSONObject;
                          ^

然后我试了

import com.googlecode.json_simple.JSONObject;

但得到了:

error: package com.googlecode.json_simple.parser does not exist
import com.googlecode.json_simple.parser.JSONParser;
                                        ^

如何让它发挥作用?

我敢肯定你忘了将外部 Maven 库添加到项目中。看一下这个:

...并输入:org.apache.clerezza.ext:org.json.simple:0.4