Another option is to add a routine like this to the init target -
<!-- check for java version and fail build if not the correct version -->
<echo message="Java Version: ${java.version}"/>
<echo message="Java home: ${java.home}"/>
<fail message="Unsupported Java version: ${java.version}. Make sure that
the version of the Java compiler is 1.5 (5.0) or greater.">
<condition>
<not>
<or>
<contains string="${java.version}" substring="1.5"
casesensitive="false" />
<contains string="${java.version}" substring="1.6"
casesensitive="false" />
</or>
</not>
</condition>
</fail>
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Tuesday, July 27, 2010 9:11 AM
To: [email protected]
Subject: AW: How to check if available java version is higher equal than a
required java version?
Check for Classes which are new in that specific JDK.
<available property="jdk1.5+" classname="java.net.Proxy"/>
<available property="jdk1.6+" classname="java.util.ServiceLoader"/>
<fail message="Require JDK 1.5 or higher" unless="jdk1.5+"/>
Jan
>-----Ursprüngliche Nachricht-----
>Von: Ben Stover [mailto:[email protected]]
>Gesendet: Dienstag, 27. Juli 2010 14:35
>An: Ant Users
>Betreff: How to check if available java version is higher
>equal than a required java version?
>
>Assume I have a build.xml which contains some java tasks
>(javac, jar,...)
>
>I would like to make sure that the Java installation which is
>used to compile the source code is higher equal
>than e.g. JAVA SE 1.5.03.
>
>How can I specify this version requirement (and an appropriate
>error message) in a build.xml script?
>
>Ben
>
>
>
>
>
>
>---------------------------------------------------------------------
>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]
_____________
The information contained in this message is proprietary and/or confidential.
If you are not the intended recipient, please: (i) delete the message and all
copies; (ii) do not disclose, distribute or use the message in any manner; and
(iii) notify the sender immediately. In addition, please be aware that any
message addressed to our domain is subject to archiving and review by persons
other than the intended recipient. Thank you.
_____________
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]