You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by gautam m <ga...@lycos.com> on 2004/01/01 12:10:15 UTC

Setiing classpath in ANT

Hi,
   I have just started using ANT

I am using following script:-
<project name="Gautam" default="all" basedir=".">
     <description>
        simple build file
    </description>

  <!-- set global properties for this build -->
  <property name="source" value="."/>
  <property name="build" location="build"/>

  <target name="init" >
    <!-- create a timestamp -->
  <tstamp/>
  <!-- Create Build directory -->
  <mkdir dir="${build}"/>
  </target>

  <target name="compile" depends="init" >
    <!-- Compile the java code from ${source} into ${build} -->
    <javac srcdir="${source}" deprecation="${DEPRECATION}"
      destdir="${build}"
      includes="*.java"
    />
  </target>

  <!-- Run the example -->
<project name="Gautam" default="all" basedir=".">
     <description>
        simple build file
    </description>

  <!-- set global properties for this build -->
  <property name="source" value="."/>
  <property name="build" location="build"/>

  <target name="init" >
    <!-- create a timestamp -->
  <tstamp/>
  <!-- Create Build directory -->
  <mkdir dir="${build}"/>
  </target>

  <target name="compile" depends="init" >
    <!-- Compile the java code from ${source} into ${build} -->
    <javac srcdir="${source}"
      destdir="${build}"
      includes="Hello.java"
    />
  </target>

  <!-- Run the example -->
  <target name="run" depends="compile">
  <java classname="Hello" />
  </target>

  <!-- Delete the files -->
  <target name="clean" description="clean up" >
  <delete dir="${build}" />
  </target>

<target name="all" depends="init,compile,run"/>
</project>

When i execute ,the program gets compiled but it dosen't run. I get message Hello not found...
If i add "build" directory outside i dont get the message.

How do i set classpath in script..

Thanx a lot 

Gautam



____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org