我使用json-simple作为外部Jar到我的Eclipse项目。 此外部JAR类路径是否正确设置成.classpath文件:Jar内Eclipse项目运行时错误
<?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 [...]
我不明白为什么,我觉得我失去了一些东西,但我无法弄清楚。
谢谢你的帮助。
你是如何运行代码? – Jeremy
我使用Eclipse运行它(运行菜单 - >运行)。这是一个Android项目,我在模拟器上运行它。 – TPPZ