You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Samar Hossam <Sa...@web.de> on 2004/08/26 11:51:36 UTC

"classpath" attribute in the "javac" task

Hi everyone,

I am new to Ant and I would like to ask you for help.

I was reading in the Ant's manual when I encountered this example:

<javac srcdir="${src}"
         destdir="${build}"
         classpath="xyz.jar"
         debug="on"/>

This task compiles all .java files under the ${src} directory, and stores the .class files in the ${build} directory. The classpath used includes xyz.jar, and compiling with debug information is on.

My question is: Why do I need to point to a .jar file using the classpath, when I have all my sources in the ${src} directory and after the compilation I'll get all the classes in the ${build} directory?

I'd appreciate your help.

Regards,
   Samar Hossam

_______________________________________________________
WEB.DE Video-Mail - Sagen Sie mehr mit bewegten Bildern
Informationen unter: http://freemail.web.de/?mc=021199


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


Re: "classpath" attribute in the "javac" task

Posted by Olivier Croisier <Ol...@thales-is.com>.
Hi

The "classpath" attribute is helpful when you use external jars.

For example, you write an application that relies on some classes provided by "foo.jar".
That "foo.jar" must be in the classpath in order for the java compiler to see and use the jar's classes.



-- 
CROISIER Olivier
Software Engineer
Thales IS - ANS
olivier.croisier@thales-is.com

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


Re: "classpath" attribute in the "javac" task

Posted by Angeshwar Deepak <an...@yahoo.com>.
Hi,

It is something like typing 

SET CLASSPATH=D:\abcd\ant-1.5\lib\Tidy.jar; 

in the command prompt and then running javac to get
the class file.

bye,
with regards,
Deepak.


--- Samar Hossam <Sa...@web.de> wrote:

> Hi everyone,
> 
> I am new to Ant and I would like to ask you for
> help.
> 
> I was reading in the Ant's manual when I encountered
> this example:
> 
> <javac srcdir="${src}"
>          destdir="${build}"
>          classpath="xyz.jar"
>          debug="on"/>
> 
> This task compiles all .java files under the ${src}
> directory, and stores the .class files in the
> ${build} directory. The classpath used includes
> xyz.jar, and compiling with debug information is on.
> 
> My question is: Why do I need to point to a .jar
> file using the classpath, when I have all my sources
> in the ${src} directory and after the compilation
> I'll get all the classes in the ${build} directory?
> 
> I'd appreciate your help.
> 
> Regards,
>    Samar Hossam
> 
>
_______________________________________________________
> WEB.DE Video-Mail - Sagen Sie mehr mit bewegten
> Bildern
> Informationen unter:
> http://freemail.web.de/?mc=021199
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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