Ant environment variable "ant.java.version" returns 1.8 for Openj9 SDK
Mesbah-Alam opened this issue · comments
Overview
We have a dependency on Ant environment variable "ant.java.version" in our logic in openjdk.build/include/top.xml (target check-for-tools-jar), where we are trying to figure out the SDK we are testing. If it's Java 8, we copy tools.jar in prereqs folder, if Java 9 we do not.
This however doesn't work very well, since Ant is returning 1.8 as the value for "ant.java.version" even when we are running on Open9.
To reproduce
- Log into a Linux machine
- Set JAVA_HOME to OpenJ9 SDK (e,g, http://vmtank.ottawa.ibm.com/vm_archive/R29/xa6490/ibuild_good/xa6490_openj9.zip)
- Run: ant -diagnostics | grep ant.java.version -- it will print 1.8.
It appears as though Ant is not processing the OpenJ9 SDK version information properly and ending up with wrong SDK version for OpenJ9.
I ran "ant -diagnostics" with both IBM Java 8 SR6, and OpenJ9. Below are some comparison of values I got for some of the relevant Ant variables.
OpenJ9
ant.java.version : 1.8
java.vm.version : 2.9
java.vm.vendor : Eclipse OpenJ9
java.runtime.version : 9-internal+0-adhoc.openj9.openjdk
java.fullversion : 9-internal+0-adhoc.openj9.openjdk
JRE 9 IBM J9 2.9 Linux amd64-64 Compressed References 20171025_368423 (JIT enabled, AOT enabled)
OpenJ9 - b13c187
OMR - 604be15
java.specification.version : 9
java.vm.specification.version : 9
java.version : 9-internal
IBM Java 8 SR6
ant.java.version: 1.8
java.vm.version : 2.9
java.vm.vendor : IBM Corporation
java.runtime.version : 8.0.6.0 - pxa6480sr6-20171012_01(SR6)
java.fullversion : 8.0.6.0 - pxa6480sr6-20171012_01(SR6)
JRE 1.8.0 IBM J9 2.9 Linux amd64-64 Compressed References 20171011_366953 (JIT enabled, AOT enabled)
OpenJ9 - 26f4ca3
OMR - 5d625a3
IBM - f0d7065
java.specification.version : 1.8
java.vm.specification.version : 1.8
java.version : 1.8.0_151
So, as a workaround, in our top.xml, we could depend on one of the other Ant environment varialbes (e.g. "java.version", or "java.specification.version", etc) instead of "ant.java.version".
@lumpfish - any suggestion?
This issue blocks the openjdk-systemtest OpenJ9 build to be runnable in Ottawa.
Using java.specification.version - as a temporary fix (in my branch) to unblock the OpenJ9 build.
PR delivered for this issue: https://github.com/AdoptOpenJDK/openjdk-systemtest/pull/24/files