Javac在ant build中不起作用

时间:2012-07-26 12:09:01

标签: java ubuntu ant javac build.xml

我尝试在ubuntu 11.02的命令行上运行ant build.xml中的javac。 然后运行“ant deploy-live”,命令行打印如下:

Compile failed; see the compiler error output for details.
    at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1150)
    at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:912)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:809)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

关于javac的任务:

<javac deprecation="true"
               includeantruntime="false"
               debug="true"
               debuglevel="${debuglevel}"
               destdir="${project.build.outputpath}"
               verbose="true"
               encoding="UTF-8">
            <src path="${project.src.classes}" />
            <compilerarg value="-Xlint" />
            <classpath refid="core.classpath" />
</javac>

O的: Ubuntu 11.10(oneiric)

Java版本: java版“1.7.0” Java(TM)SE运行时环境(版本1.7.0-b147) Java HotSpot(TM)64位服务器VM(版本21.0-b17,混合模式)

Ant版本: 2011年8月19日编译的Apache Ant(TM)版本1.8.2

我尝试编写build.xml文件,但无法正常工作。

请帮忙

1 个答案:

答案 0 :(得分:1)

首先你需要计算错误细节

尝试使用-debug或-verbose标志运行

http://ant.apache.org/manual/running.html 影响Ant输出日志量的选项有:-quiet,它指示Ant向控制台输出较少的信息; -verbose,导致Ant将其他信息打印到控制台;和-debug,这会导致Ant打印更多的附加信息。

并在此处提交错误详情以供后续分析...