【发布时间】:2020-11-03 18:15:21
【问题描述】:
我正在this site 上使用 JSON-Simple 练习 Java JSON 编程,上面写着:
支持 maven repo 中所有可用的 jars。
更新:
所以我现在已将外部 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;
^
如何让它发挥作用?
【问题讨论】:
-
好吧...然后尝试使用旧版本 com.googlecode.json-simple:json-simple:1.1 并使用 import org.json.simple.JSONObject;