【发布时间】:2023-09-29 05:25:01
【问题描述】:
我在我的 Eclipse 项目中使用json-simple 作为外部 Jar。 这个 external Jar 的 Classpath 已正确设置到 .classpath 文件中:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
[...]
<classpathentry kind="lib" path="json-simple-1.1.1.jar"/>
[...]
</classpath>
Java 代码编译没有任何错误。
当我运行编译后的代码时,我得到以下运行时错误:
Could not find class 'org.json.simple.parser.JSONParser', referenced from method [...]
我不明白为什么,我想我遗漏了一些东西,但我无法弄清楚。
谢谢你的帮助。
【问题讨论】:
-
你是如何运行代码的?
-
我正在使用 Eclipse 运行它(运行菜单 -> 运行)。这是一个Android项目,我是在模拟器上运行的。
标签: java eclipse android-emulator jar classpath