打包类的NoClassDefFoundError

时间:2010-06-16 17:57:16

标签: java eclipse classpath noclassdeffounderror

我正在尝试运行使用YouTube Data API的jar文件,而我正在为其中一个API类获取NoClassDefFoundError:

alt text http://img205.imageshack.us/img205/1808/noclassdeffounderror.png

AuthenticationException.class可以在gdata-core-1.0 jar中找到:

alt text http://img683.imageshack.us/img683/7329/authenticationexception.png

gdata-core-1.0 jar已添加到我的类路径中:

alt text http://img24.imageshack.us/img24/2195/classpathe.png

我做错了什么?

2 个答案:

答案 0 :(得分:1)

你的jar文件是否包含必要的库?当您在eclipse之外执行程序时,eclipse中定义的类路径不适用。

如果不是,您可以查看已经回答的question

答案 1 :(得分:0)

也许你可能没有在类路径中使用jar。命令提示符执行不会设置类路径。你必须自己做,或者在执行时动手给它。

您应该看看为JAR文件设置MANIFEST文件是否正确。

post有更好的描述

相关问题