Problem with "Includeantruntime is not set" warning in apache-ant compilation? _includeantruntime

Source: Internet
Author: User

Recent learning Apache-ant run with a warning:


Warning:

D:\>ant Run
Buildfile:d:\build.xml
Clean
[Delete] Deleting directory D:\build
Compile
[MkDir] Created dir:d:\build\classes
[Javac] D:\build.xml:126:warning: ' Includeantruntime ' is not set, Defaulti
Ng to Build.sysclasspath=last; Set to False for repeatable builds
[Javac] Compiling 1 source file to D:\build\classes
Run
[Java] Study-apache-ant-demo
Build successful
Total time:0 seconds

Solution:

<project name= "Javatest" default= "Run" basedir= "." >
<target name= "clean" description= "Clear Catalog" >
<delete dir= "Build"/>
</target>

<target name= "Compile" depends= "clean" description= "compiling" >
<mkdir dir= "Build/classes"/>
<javac srcdir= "src" destdir= "build/classes" includeantruntime= "on"/>
</target>

<target name= "Run" depends= "compile" description= "Running" >
<java classname= "Demo" >
<classpath>
<pathelement path= "Build/classes"/>
</classpath>
</java>
</target>
</project>

That is, add Includeantruntime= "on". Some add Includeantruntime= "false",

Some add includeantruntime= "20000"


Note:
1. For the Includeantruntime attribute, the official explanation is as follows:
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 isn't sensitive to the environment in which it is run.
2. This warning may not occur in an earlier ANT version, and the current version is: Apache Ant (TM) version 1.8.2 compiled on December 20 2010. So this problem is related to the ant version.


My ant version: Apache ant (TM) version 1.9.9 compiled on February 2 2017



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.