ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey N. Solofnenko" <A.Solofne...@mdl.com>
Subject Re: Detecting JDK Version using ANT
Date Wed, 15 Jun 2005 20:18:21 GMT
Actually the best property is ${java.specification.version} it is just 
two digit version 1.4 or 1.5.

- Alexey.

Ivan Ivanov wrote:
> Hello, 
>
> you can try with java.version property:
>
> <project>
>     <echo>$${java.version} is ${java.version}</echo>
>     <echo>$${java.runtime.version} is
> ${java.runtime.version}</echo>
>     <!-- Dumps all properties starting with "java" -->
>     <echoproperties prefix="java"/>
> </project>
>
> Regards
> Ivan
>
> --- Zarar Siddiqi <zarar.siddiqi@utoronto.ca> wrote:
>
>   
>> Hi,
>>
>> Is there a clean way to detect what version of Java
>> is being used when running a build file?
>>
>> Some possible solutions include:
>>
>> 1) parsing the JAVA_HOME variable to detect the
>> version number
>> 2) Checking the existence of a file which is
>> specific to a version
>>
>> Both methods are somewhat brittle.
>>
>> Is there a sureshot way of knowing whether ANT is
>> being invoked using Java 1.5 or not?
>>
>> Thanks in advance,
>> Zarar
>>     

-- 
------------------------------------------------------------------------
/ Alexey N. Solofnenko
home: http://trelony.cjb.net/
/

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


Mime
View raw message