Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Eclipse AntRunner在控制台上显示ant任务javac编译错误_Ant_Eclipse Plugin - Fatal编程技术网

如何使用Eclipse AntRunner在控制台上显示ant任务javac编译错误

如何使用Eclipse AntRunner在控制台上显示ant任务javac编译错误,ant,eclipse-plugin,Ant,Eclipse Plugin,我用Elcipse的AntRunner来执行Ant任务。在执行javac任务时,如果发生任何编译错误,我将在控制台中获得以下错误消息 C:\build.xml:41: Compile failed; see the compiler error output for details. 在控制台上显示实际编译错误需要做什么?如何在文件中记录相同的内容。谢谢我没有使用Ant eclipse插件,但我认为这可能是因为插件中缺少功能,而不是Ant本身 如果您可以从终端(或windows上的命令提示符)

我用Elcipse的AntRunner来执行Ant任务。在执行javac任务时,如果发生任何编译错误,我将在控制台中获得以下错误消息

C:\build.xml:41: Compile failed; see the compiler error output for details.

在控制台上显示实际编译错误需要做什么?如何在文件中记录相同的内容。谢谢

我没有使用Ant eclipse插件,但我认为这可能是因为插件中缺少功能,而不是Ant本身


如果您可以从终端(或windows上的命令提示符)运行Ant,请尝试运行
Ant-verbose
,以便Ant输出更多信息。

当Eclipse AntRunner使用时,在控制台上显示编译错误

可以使用AddBuildListenerAPI

创建一个扩展org.apache.tools.ant.DefaultLogger的类。比如说

Class MyLogger extends DefaultLogger {

    // All overridden method implementation goes here
  }

//  To use with AntRunner:

   AntRunner antRunner = new AntRunner();
   antRunner.addBuildListener(MyLogger.class.getName());

您好,谢谢您的回答,我不打算通过cmd运行脚本,但在javac任务中,我将verbose值设置为“true”,这没有帮助。因此,我认为从插件中我遗漏了一些东西