使用ant build build.xml报“includeantruntime was not set”警告及"Class not found: javac1.8"问题
问题1:ant编译build.xml报“includeantruntime was not set”警告。
警告详情:
1 warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
解决方法:
根据提示在javac任务中添加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版本有关。
问题2:ant编译时,报"Class not found: javac1.8"error
问题原因:myeclipse中自带的ant插件版本太低。
解决方法:重新下载ant版本,并配置环境变量。
配置环境变量:ANT_HOME, path,classpath.
更换MyEclipse中的Ant为自己指定的。方法:Window >>Preferences>>Ant>>Runtime选中右边框中的Ant Home Entries,点击Add Home按钮;选择你自己的安装目录。