Merge "Unset _JAVA_OPTIONS before running "java -version"."

This commit is contained in:
Ying Wang 2014-04-03 01:47:18 +00:00 committed by Gerrit Code Review
commit 59ff600927

View file

@ -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")