You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ben Stover <bx...@yahoo.co.uk> on 2010/07/22 09:28:21 UTC

How to set new PATH, CLASSPATH and JAVA_HOME for whole build.xml?

Assume I have multiple Java installations and versions on my computer.
Due to other reasons I have to set java installation1 as default in my environment
variables PATH, CLASSPATH and JAVA_HOME.

Beside the main application I would like to do some other compilations and tasks
with/from Ants build.xml scripts.

However for these Ant build.xml I want to use the other, second java installation2.

How can I specify on top of such an build.xml different environment variables
resp. define additional PATHs, CLASSPATHs with higher priority then the "outer" defaults?

To clarify: I don't want to prepend in all targets the new, second path multiple times.
Instead I want to define ONCE FOR ALL TASKs and TARGETs inside the current build.xml
the new environment variable values.

How can I do this?

Ben






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


AW: How to set new PATH, CLASSPATH and JAVA_HOME for whole build.xml?

Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
Just use a Batch or shellfile, that calls Ant.
Before you call Ant you set your environment.

-----Ursprüngliche Nachricht-----
Von: Ben Stover [mailto:bxstover@yahoo.co.uk] 
Gesendet: Donnerstag, 22. Juli 2010 09:28
An: Ant Users
Betreff: How to set new PATH, CLASSPATH and JAVA_HOME for whole build.xml?

Assume I have multiple Java installations and versions on my computer.
Due to other reasons I have to set java installation1 as default in my environment
variables PATH, CLASSPATH and JAVA_HOME.

Beside the main application I would like to do some other compilations and tasks
with/from Ants build.xml scripts.

However for these Ant build.xml I want to use the other, second java installation2.

How can I specify on top of such an build.xml different environment variables
resp. define additional PATHs, CLASSPATHs with higher priority then the "outer" defaults?

To clarify: I don't want to prepend in all targets the new, second path multiple times.
Instead I want to define ONCE FOR ALL TASKs and TARGETs inside the current build.xml
the new environment variable values.

How can I do this?

Ben






---------------------------------------------------------------------
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