0
我正在學習Java ant。我在eclipse call hello world中創建了一個項目。然後我做了一個項目導出並創建了一個ant構建文件。當運行失敗的螞蟻文件抱怨:BUILD FAILED C:\用戶** \工作空間\的HelloWorld \ build.xml中:31:沒有發現類別:javac1.8因爲沒有找到類,Java ant build失敗
並指向這一行:
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
我正在使用eclipse kepler。
這裏是我的build.xml文件:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one in the same
directory with the processing instruction <?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="HelloWorld">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.2"/>
<property name="source" value="1.3"/>
<path id="HelloWorld.classpath">
<pathelement location="bin"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src"/>
<classpath refid="HelloWorld.classpath"/>
</javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target name="HelloWorld">
<java classname="HelloWorld" failonerror="true" fork="yes">
<classpath refid="HelloWorld.classpath"/>
</java>
</target>
</project>
有誰知道爲什麼發生這種情況?
如何更新我的螞蟻的版本,因爲它是似乎指向日食插件文件夾 –
這裏的答案完美解釋:http://stackoverflow.com/questions/5206431/how-to-upgrade-the-ant-built-into-eclipse – Bone
嘿,我做了你問我在這一行仍然會出現相同的錯誤:'' –