summaryrefslogtreecommitdiffstats
path: root/core/main.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-04-03 01:57:25 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-03 01:57:25 +0000
commit88e1a1103acaf5e61fd11a7c006a0c465214ac78 (patch)
treea0979d3d765109d279f7371759938c28afa029ba /core/main.mk
parent5fe1b387aace96990723c16e3e23a27b166483c5 (diff)
parent680e037007fd0f4207a4734b8fccce17a91ee682 (diff)
downloadbuild-88e1a1103acaf5e61fd11a7c006a0c465214ac78.zip
build-88e1a1103acaf5e61fd11a7c006a0c465214ac78.tar.gz
build-88e1a1103acaf5e61fd11a7c006a0c465214ac78.tar.bz2
am 680e0370: am 59ff6009: Merge "Unset _JAVA_OPTIONS before running "java -version"."
* commit '680e037007fd0f4207a4734b8fccce17a91ee682': Unset _JAVA_OPTIONS before running "java -version".
Diffstat (limited to 'core/main.mk')
-rw-r--r--core/main.mk12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/main.mk b/core/main.mk
index a658295..f7130bf 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -151,8 +151,8 @@ requires_openjdk := true
endif
endif
-java_version_str := $(shell java -version 2>&1)
-javac_version_str := $(shell javac -version 2>&1)
+java_version_str := $(shell unset _JAVA_OPTIONS && java -version 2>&1)
+javac_version_str := $(shell unset _JAVA_OPTIONS && javac -version 2>&1)
# Check for the current jdk
ifeq ($(requires_openjdk), true)
@@ -187,13 +187,13 @@ endif # if requires_openjdk
ifneq ($(EXPERIMENTAL_USE_JAVA7),)
required_version := "1.7.x"
required_javac_version := "1.7"
-java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.7[\. "$$]' | head -n 1)
-javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.7[\. "$$]' | head -n 1)
+java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.7[\. "$$]')
+javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.7[\. "$$]')
else # if EXPERIMENTAL_USE_JAVA7
required_version := "1.6.x"
required_javac_version := "1.6"
-java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.6[\. "$$]' | head -n 1)
-javac_version := $(shell echo '$(javac_version_str)' | head -n 1 | grep '[ "]1\.6[\. "$$]' | head -n 1)
+java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.6[\. "$$]')
+javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.6[\. "$$]')
endif # if EXPERIMENTAL_USE_JAVA7
ifeq ($(required_javac_version), "1.6")