You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Da...@lawson.com on 2001/05/03 00:31:05 UTC

Passed in $CLASSPATH versus javac classpath



I'm invoking ant with a wrapper script, which calls ant using

     '$JAVACMD -classpath $LOCALCLASSPATH $ANT_OPTS org.apache.tools.ant.Main
$ENVOPTS $@'

It appears that whenever ant encounters a <javac> task, it uses the passed in
$LOCALCLASSPATH instead of any path specified using the "classpath" attribute of
the <javac> task.  Is this expected behavior?  Is there anything that can be
done (other than refraining from using the '-classpath' option in the wrapper)
to make ant use the classpath specified in the <javac> task rather than the one
passed via the '-classpath' option?

Thanks,

--dave



Re: Passed in $CLASSPATH versus javac classpath

Posted by Stefan Bodewig <bo...@apache.org>.
David Bailey <Da...@lawson.com> wrote:

> It appears that whenever ant encounters a <javac> task, it uses the
> passed in $LOCALCLASSPATH instead of any path specified using the
> "classpath" attribute of the <javac> task.

No, it prepends the passed in CLASSPATH by default (changeable via
build.sysclasspath).

If you don't want to use your LOCALCLASSPATH at all, see <javac>'s
includeantruntime attribute.

Stefan

Re: Passed in $CLASSPATH versus javac classpath

Posted by Stefan Bodewig <bo...@apache.org>.
J. D. Fagan <jf...@us.dhl.com> wrote:

> I believe in Ant 1.4, you can change the classpath behavior with
> build.sysclasspath:

This property has already been present (but undocumented) in Ant 1.3.

Stefan

RE: Passed in $CLASSPATH versus javac classpath

Posted by "J.D. Fagan" <jf...@us.dhl.com>.
I believe in Ant 1.4, you can change the classpath behavior with
build.sysclasspath:

build.sysclasspath
The value of the build.sysclasspath property control how the system
classpath, ie. the classpath in effect when Ant is run, affects the
behaviour of classpaths in Ant. The default behavior varies from Ant to Ant
task.

The values and their meanings are:
only Only the system classpath is used and classpaths specified in build
files, etc are ignored. This situation could be considered as the person
running the build file knows more about the environment than the person
writing the build file

ignore The system classpath is ignored. This situation is the reverse of the
above. The person running the build trusts the build file writer to get the
build file right

last The classpath is concatenated to any specified classpaths at the end.
This is a compromise, where the build file writer has priority.

first Any specified classpaths are concatenated to the system classpath.
This is the other form of compromise where the build runner has priority.

JD

-----Original Message-----
From: David.Bailey@lawson.com [mailto:David.Bailey@lawson.com]
Sent: Wednesday, May 02, 2001 3:31 PM
To: ant-user@jakarta.apache.org
Subject: Passed in $CLASSPATH versus javac classpath





I'm invoking ant with a wrapper script, which calls ant using

     '$JAVACMD -classpath $LOCALCLASSPATH $ANT_OPTS
org.apache.tools.ant.Main
$ENVOPTS $@'

It appears that whenever ant encounters a <javac> task, it uses the passed
in
$LOCALCLASSPATH instead of any path specified using the "classpath"
attribute of
the <javac> task.  Is this expected behavior?  Is there anything that can be
done (other than refraining from using the '-classpath' option in the
wrapper)
to make ant use the classpath specified in the <javac> task rather than the
one
passed via the '-classpath' option?

Thanks,

--dave