希望有人能帮我解决这个问题。
我正在使用 Ant 脚本来编译我的 java 代码,但出现以下错误:
[junitreport] Processing /home/sander/workspace/AntIntro/reports/junit/TESTS-TestSuites.xml to /tmp/null1570204945<br />
[junitreport] Loading stylesheet jar:file:/usr/share/eclipse/plugins/org.apache.ant_1.8.2.v20120109-1030/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl<br />
[junitreport] : Error! The first argument to the non-static Java function 'replace' is not a valid object reference.<br />
[junitreport] : Error! Cannot convert data-type 'void' to 'reference'.<br />
[junitreport] : Fatal Error! Could not compile stylesheet<br />
[junitreport] Failed to process /home/sander/workspace/AntIntro/reports/junit/TESTS-TestSuites.xml
我正在使用:
- Eclipse 3.7.2
- OpenJDK 7
- Archlinux x64
- JUnit 4
- Ant 1.7.2
希望有人能帮助我,先谢谢了
最佳答案
请参阅我之前的评论。这是一个已知问题,解决方法是使用 apache-ant-1.8.3 与 JDK-7 或 apache-ant-1.8.2 与 JDK-6。
关于java - Ant 在 Linux 上构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12191468/