ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Toens" <sto...@bea.com>
Subject RE: Setiing classpath in ANT
Date Thu, 01 Jan 2004 22:41:19 GMT
Gautam,

Check out the Ant Manual: http://ant.apache.org/manual/index.html -> core tasks -> Java.

You can either set the "classpath" or the "classpathref" attributes on the "Java" task.

So something like <java ... classpath="${build}"/> should work.


Simon

-----Original Message-----
From: gautam m [mailto:gautamms_10@lycos.com]
Sent: Thursday, January 01, 2004 3:10 AM
To: user@ant.apache.org
Subject: 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


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


Mime
View raw message