ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahamim, Zvi (Zvi) ** CTR **" <>
Subject RE: Specifying jdk compiler
Date Mon, 02 Jun 2003 04:51:58 GMT
Thank you Antoine Levy-Lambert
your answer is exactly what I wanted.
Regards to question 3:
If I specify in the javac task that the compiler attribute is "modern" the jdk 1.3 will be
used (and inside the code I can see that a Javac13 object will be created).
I wnat to create a Javac14 that uses javac.exe in a specific location.
I hope I explained better this time ;-)


-----Original Message-----
From: Antoine Levy-Lambert []
Sent: Sunday, June 01, 2003 6:28 PM
To: Ant Users List
Subject: Re: Specifying jdk compiler

Hi Rahamim,

I do not understand your question number 3.

For your question number 2 :
If you want to find the java version installed under a specific path in your
ant script, you can use the <exec/> task.
It has an outputproperty attribute, with which you can capture in a property
value the stdout produced by a program,
<exec executable="I:/Projects/JavaDevel/jdk1.4.1_02/java"
   <arg value="-version"/>
then you will have a property ${javaversioninfo} with version info.
Or maybe you want to write something in your classes to say with which
compiler you produced them ?
----- Original Message -----
From: "Rahamim, Zvi (Zvi) ** CTR **" <>
To: "Ant Users List" <>
Sent: Sunday, June 01, 2003 8:02 AM
Subject: Specifying jdk compiler

I have an ant script that use the javac and rmic tasks.
They use the jdk that runs ant (I don't use fork in the javac task)
Now I want to use another compiler and I used fork and executable attributes
in the javac task but then the rmic task failed with the following error:
Cannot use SUN rmic, as it is not available.  A common solution is to set
the environment variable JAVA_HOME or CLASSPATH.
1. Can you tell me why it happens and how to solve it ?

I have jdk on my computer on a different pathes and with different versions
(e.g: I:/Projects/JavaDevel/jdk1.3.1_02/ and
2. I know that I can use the javac executable attribute to compile with the
above compilers, but how can I get from withing the script their versions
(by now I've used the property value: "java.vm.version".
3. If I want to create a class for Javac_131_02 and Javac_141_02 that
compiles using the above jdk, how can I do it (except for extends

Thanks in advance!!!

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message