将 Ant 与 PHPUnderControl 一起使用会出现 java.lang.NoClassDefFoundError
我已经安装了最新的 CruiseControl 和 PHPUnderControl,并遵循了所有指示。 我陷入运行“../../apache-ant-1.7.0/bin/ant checkout”并得到下面的输出。 在Google上搜索错误,建议将JVM路径添加到Ant脚本中,但这并没有改变任何东西。
即使“ant --version”也会输出此错误。
在运行的任何其他应用程序上似乎没有其他与 java 相关的问题。
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.tools.ant.launch.Launcher
at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
at __gcj_personality_v0 (/var/www/internal/cruisecontrol/cruisecontrol-bin-2.8.2/projects/mytrial/java.version=1.4.2)
at __libc_start_main (/lib/tls/libc-2.3.4.so)
at _Jv_RegisterClasses (/var/www/internal/cruisecontrol/cruisecontrol-bin-2.8.2/projects/mytrial/java.version=1.4.2)
我已将 Ant 更新到 1.7.1,问题仍然存在。 我也尝试将 Java 更新到 1.6,但安装后仍然报告为 1.4.2。
类路径不是问题,Ant 网站明确表示不要使用 CLASSPATH。
I've installed the latest CruiseControl and PHPUnderControl, and followed all the directions.
I get stuck at running "../../apache-ant-1.7.0/bin/ant checkout" and get the output below.
Searching for the error on Google, it was suggested to add the JVM path to the Ant script, but this did not change anything.
Even "ant --version" outputs this error.
There seems to be no other java related issues on any other apps running.
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.tools.ant.launch.Launcher
at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
at __gcj_personality_v0 (/var/www/internal/cruisecontrol/cruisecontrol-bin-2.8.2/projects/mytrial/java.version=1.4.2)
at __libc_start_main (/lib/tls/libc-2.3.4.so)
at _Jv_RegisterClasses (/var/www/internal/cruisecontrol/cruisecontrol-bin-2.8.2/projects/mytrial/java.version=1.4.2)
I've updated Ant to 1.7.1 and the issue persists. I've also tried updating Java to 1.6, but after being installed it still reports as being 1.4.2.
Classpath was not the issue, and the Ant website explicitly says not to use CLASSPATH.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Java 1.6 解决了这个问题。
我必须修改 /usr/sbin/alteratives 才能使用新版本的 Java。
Using Java 1.6 resolved the issue.
I had to modify /usr/sbin/alteratives to use the new version of Java.
一种想法是尝试将 ant.jar 添加到类路径中。 您应该在
apache-ant-1.7.0/lib/ant.jar
中找到该 jar。 但是,我不知道如何在 PHPUnderControl 中指定类路径 - 我还没有看到该工具。One idea would be to try to add the
ant.jar
to the classpath. You should find the jar atapache-ant-1.7.0/lib/ant.jar
. However, I have no idea how do you specify the classpath in PHPUnderControl -- I haven't seen that tool.