ant编译是出现“includeantruntime was not set”警告--如何解决呢?

戚薇 Java经验 发布时间:2023-07-09 18:35:44 阅读数:13417 1
下文笔者讲述运行ant编译时,出现以下警告信息的解决方法分享,如下所示
[javac] D:\Test\build.xml:33: warning: 'includeantRuntime' was not set, 
defaulting to build.sysclasspath=last; set to false for repeatable builds

这个警告信息不影响编译
   但本人有洁癖,必须解决才安心,通过查阅官方文档,我们得知
   我们只需在javac中添加相关的属性即可解决此类异常
   只需在javac中添加includeAntRuntime="false"属性
    即可避免此警告
例:避免includeantruntime警告的示例
修改前:
  <javac srcdir="${srcDir}" destdir="${binDir}" />

修改后:
  <javac srcdir="${srcDir}" destdir="${binDir}"
      includeAntRuntime="false" />
注意事项:
    1.关于includeAntRuntime属性,官方说明:
       Whether to include the Ant run-time libraries in the classpath; 
	   defaults to yes, unless build.sysclasspath is set. 
	   It is usually best to set this to false so the script's behavior 
	   is not sensitive to the environment in which it is run.
     2.此警告在较早的ant版本中可能不会出现
       当前用的版本是:Apache Ant(TM) version 1.8.2 compiled on December 20 2010
	   所以此问题跟ant版本有关
版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。

本文链接: https://www.Java265.com/JavaJingYan/202307/16888989787041.html

最近发表

热门文章

好文推荐

Java265.com

https://www.java265.com

站长统计|粤ICP备14097017号-3

Powered By Java265.com信息维护小组

使用手机扫描二维码

关注我们看更多资讯

java爱好者