2012-08-30 136 views
0

我希望有人能帮我解决这个问题。 我使用Ant脚本来编译我的Java代码,但我得到了以下错误:
蚂蚁未能建立在Linux上

[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的
- 64的Archlinux
- JUnit 4中
- 蚂蚁1.7.2

希望有人能帮助我,提前谢谢

+0

查看从这里回答:http://stackoverflow.com/questions/10607151/error-the-first-argument-to-the-non-static-java-function-replace-is-not-a-val – dan

回答

0

查看我以前的评论。这是一个已知的问题,解决方法是在JDK-7中使用apache-ant-1.8.3,在JDK-6中使用apache-ant-1.8.2。

+0

我现在从命令行运行ant,这似乎是解决此问题的唯一解决方案。 – san