tags:

views:

92

answers:

2

I'm trying to use Ant, and I get this error when I type "ant" into the command line for my compile target:

[javac] C:\development\src\j3\textprocess\build.xml:15: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

Did I not set something up correctly?

Here is my build.xml file as well:

<?xml version="1.0"?> 
    <project name="TextProcess" default="compile" basedir="."> 
    <property environment="env"/> 
    <property name="src" value="${basedir}/src" /> 
    <property name="bin" value="${basedir}/bin" /> 
    <property name="lib" value="${basedir}/lib" /> 
    <property name="doc" value="${basedir}/doc" /> 
    <property name="build" value="${basedir}/build" /> 

    <target name="prepare" description="Setting up temporary directory to support build."> 
    <mkdir dir="${build}"/> 
    </target> 

    <target name="compile" depends="prepare"> 
    <javac srcdir="${src}" destdir="${build}" includes="**/*.java" listfiles="yes"> 
    </javac> 
    </target> 

    <target name="deploy" depends="compile"> 
    <jar destfile="${bin}/HelloWorld.jar" basedir="${build}"/> 
    </target> 

    <target name="run" depends="deploy"> 
    <java fork="true" classname="TextProcess"> 
    <classpath path="${bin}/TextProcess.jar"/> 
    </java> 
    </target> 

    </project>
+1  A: 

From the ant javac task documentation: "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."

Addendum: It's ant warning you that you haven't set the attribute to a particular value, so you're getting the default value, true. If that's not what you want, setting it to false will eliminate the warning.

trashgod
A: 

As the message suggests, this is a warning, not an error. So the build should run fine if this is the only message you got.

According to the documentation, includeAntRuntime defaults to true and indicates that the ant runtime libraries will be added to the classpath. As @trashgod mentions, this is best set to 'false'.

Rahul