0

我正在尝试在 linux 上运行此命令...编译成功,但在运行时出现错误。执行此命令:

java -cp .:/smash/same/hope/ant-launcher-1.6.1.jar src.vp

输出

Setting the value for property-debug
Fusion Repository/asd/file/repo
Logs Directory
Running validations
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/Project
    at src.vp.call(vp.java:114)
    at src.vp.main(vp.java:172)
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Project
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
    ... 2 more

有人能帮我解决吗...

4

1 回答 1

1

您已经包含了ant-launcherjar 文件,但我敢肯定,它不包含整个 ant。查找包含Project该类的 ant jar 文件。(根据您指定的其他文件,我希望它是 ant-1.6.1.jar。)

于 2012-10-09T21:36:58.080 回答