Eclipse导入ant编译的项目出错

导入ant项目时提示:

Specified buildfile does not contain a javac task

可修改build.xml文件,再最后一行之前添加:

<javac srcdir="src" destdir="bin" />
例如:
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="HW.makejar" default="makejar" basedir=".">
      <target name ="makejar" description="Create a jar for the HW project">
        <jar jarfile="HelloWorld.jar" includes="*.class" basedir="bin" />
      </target>
      <javac srcdir="src" destdir="bin" />
    </project>

 


 

posted @ 2013-05-28 16:31  风风清清扬扬  阅读(464)  评论(0编辑  收藏  举报