You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Denis Haskin <De...@HaskinFerguson.net> on 2001/08/13 19:54:30 UTC

Appending to the environment's classpath?

Apologies if this is a FAQ, but I searched the mailing list archives 
with no luck.

Am I correct in understanding that it's impossible to append to the 
classpath for a javac task if the classpath is set at the OS environment 
level?

I'm using 1.3 on Win2k (and Solaris, but I haven't tested it there) and 
it appears that if I don't specify any classpath in the build file, it 
takes the value of the CLASSPATH environment variable (as expected). 
 But I'd like to be able to add to the classpath within the build file, 
but for the life of me I can't figure out how to do it.  Evverything 
I've tried seems to be ignored, and the classpath stays the same 
(checking this by using -verbose or -debug).

Thanks,

dwh


Re: Appending to the environment's classpath?

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 13 Aug 2001, Denis Haskin <De...@HaskinFerguson.net> wrote:

> I just discovered something else that I think may be in play
> here... it appears ant validates filenames and paths, and if they
> don't exist, silently removes them from any places they're
> referenced.

Ant does so and the JDK does so - at least >= JDK 1.3.

> It's sort of unnerving that it doesn't tell you that it's doing
> this, even with -verbose or -debug.

True - at least in the case where Ant drops the entries it should give
the user a clue.

Stefan

Re: Appending to the environment's classpath?

Posted by Denis Haskin <De...@HaskinFerguson.net>.
Maybe, let me try it... I just discovered something else that I think 
may be in play here... it appears ant validates filenames and paths, and 
if they don't exist, silently removes them from any places they're 
referenced.  It's sort of unnerving that it doesn't tell you that it's 
doing this, even with -verbose or -debug.  Is this a known feature?

Thanks,

dwh


Erik Hatcher wrote:

>You can nest a classpath to <javac>.
>
>Something like this:
>
><classpath>
>
>    <pathelement path="${build.dir}"/>
>
>    <pathelement path="${java.class.path}" />
>
></classpath>
>
>Does that help??
>



Re: Appending to the environment's classpath?

Posted by Erik Hatcher <er...@earthlink.net>.
You can nest a classpath to <javac>.

Something like this:

<classpath>

    <pathelement path="${build.dir}"/>

    <pathelement path="${java.class.path}" />

</classpath>

Does that help??

    Erik

----- Original Message ----- 
From: "Denis Haskin" <De...@HaskinFerguson.net>
To: <an...@jakarta.apache.org>
Sent: Monday, August 13, 2001 10:54 AM
Subject: Appending to the environment's classpath?


> Apologies if this is a FAQ, but I searched the mailing list archives 
> with no luck.
> 
> Am I correct in understanding that it's impossible to append to the 
> classpath for a javac task if the classpath is set at the OS environment 
> level?
> 
> I'm using 1.3 on Win2k (and Solaris, but I haven't tested it there) and 
> it appears that if I don't specify any classpath in the build file, it 
> takes the value of the CLASSPATH environment variable (as expected). 
>  But I'd like to be able to add to the classpath within the build file, 
> but for the life of me I can't figure out how to do it.  Evverything 
> I've tried seems to be ignored, and the classpath stays the same 
> (checking this by using -verbose or -debug).
> 
> Thanks,
> 
> dwh
>