Are you going to read this or not???
if it ain't what you want, just say so... --DD
As long as you enable accessing env. vars *before* loading the properties
file, then you're OK.
<target name="test">
<property environment="env"/>
<property file="myconfig.properties"/>
<echo message="${MY_JAVA_HOME}"/>
</target>
with myconfig.properties:
MY_JAVA_HOME = ${env.JAVA_HOME}
will echo either the value of JAVA_HOME is the env. var is set, or
${MY_JAVA_HOME} if it's not. Look at the documentation for <javac> for
compiling with a different JDK. This was also discussed before, so must be
in the archives. --DD
-----Original Message-----
From: Andre Susantin [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 19, 2002 5:02 PM
To: [EMAIL PROTECTED]
Subject: How to get env variables from property file
I installed jsdk 1.3.1 and 1.4 locally d:\jdk1.3.1 (JAVA_HOME) and d:\jdk1.4
(JAVA_HOME14), and I can get the the environment
varible to ant.
The question is how, to get the env variables from property file instead of
changing the build script itself?
I want to be able to compile with a different java version based on some
property in property file.
<project name="build">
<property environment="env" />
<property name="build.sysclasspath" value="last"/>
<path id="my.classpath">
<pathelement location="${srcdir}"/>
<fileset dir="${env.JAVA_HOME14}/lib">
<include name="**/*.jar"/>
</fileset>
</path>
I could use property name like "MY_JAVA_HOME"
<fileset dir="${MY_JAVA_HOME}/lib">
<include name="**/*.jar"/>
</fileset>
And override it -DMY_JAVA_HOME=d:/jdk1.4 eg., but I prefer setting it on
property file instead
Any suggestions?
Thanks
[EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>