Now that I understand your problem (I think), why do you need to "find" the installations of the jdk's rather than having each JDK location set in a property? On any machine that is doing builds it is good practice to install the JDK's in consistent locations, this lets you create properties for them. If it is allowed to install the jdk's anywhere on the box then you can run into the situation where the installer can change the name of the directory and muck with the contents where it is installed and then you are really in for a hard time. If it is a must for the installation areas to be custom on a per box basis then why don't you have a property file (called env-override.properties or something) that contains the specific locations of the JDKs on that specififc machine. This property file can be loaded first before other property files that might contain a base location of the JDK.

Or if you have a fixed number of machines where builds can take place you can simply make the properties machine specific, something like this

[properties file=some.properties]
machine1.jdk.1.3.location=c:\\java\\ ....
machine2.jdk.1.3.location=d:\\java\\ ....
etc

[build file]
...
<property environment="env"/>
<property file="some.properties"/>

# this is in ant-contrib if you are not familiar with it
<propertycopy name="jdk1.3.location" from="${env.HOSTNAME}.jdk1.3.location"/>
...


This will pick up the property for the specific machine running the build and put it in jdk.1.3.location.

In my opinion looking down the path for jdk locations is probably not the best thing to do.

But this is just my opinion

Good Luck

Doug Lochart
Ace Technologies Inc.






Scott Simpson wrote:

Antoine Levy-Lambert wrote:

Hello Scott, Dick,

as usual a look at the manual can help. [1]

The answer is to use the fork attribute of the javac task, and specify the executable.

<javac fork="true" executable="c:/jdk1.3/bin/javac.exe"/> would do for instance.


You aren't understanding my problem. Of course I know how to call using different JDKs. The problem is finding these JDKs on the path in the first place. I want to find the JDKs on the path and pick the latest ones for 1.3, 1.4, etc.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to