Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant 1.8.1 showing incorrect java version?

Tags:

java-7

ant

I'm running Ant 1.8.1 under Win 7. And my Java version is 1.7_17.

I add the following 2 lines in my build file for diagnosing.

<echo message="java.version  = ${ant.java.version}"                   />
<echo message="java.home     = ${java.home}"                          />

And the result is

 [echo] java.version  = 1.6
 [echo] java.home     = C:\Program Files\Java\jre7

Any idea on what's going on?

Is it hardcoded in Ant 1.8.1 that the highest java version it can show is 1.6?

like image 987
David Ruan Avatar asked Mar 14 '13 19:03

David Ruan


1 Answers

I found this from Ant website. It's hardcoded actually.

ant.java.version    the JVM version Ant detected; currently it can hold
                    the values "1.2", "1.3",
                    "1.4",  "1.5" and "1.6".

After I update my Ant to 1.9.0, the issue is solved.

 [echo] java.version  = 1.7
 [echo] java.home     = C:\Program Files\Java\jdk1.7.0_17\jre

It's kind of funny. :)

like image 82
David Ruan Avatar answered Oct 04 '22 23:10

David Ruan