Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Detecting JDK Version using ANT

Detecting JDK Version using ANT

2005-06-15       - By RADEMAKERS Tanguy
Reply:     1     2     3     4     5     6     7     8     9  



<project name="test" default="check">
   <target name="check">
       <echo>java version: ${ant.java.version}</echo>      
   </target>
</project>



>-----Original Message-----
>From: Zarar Siddiqi [mailto:zarar.siddiqi@(protected)]
>Sent: Wednesday, June 15, 2005 9:49 PM
>To: user@(protected)
>Subject: Detecting JDK Version using ANT
>
>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
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.