diff --git a/core/main.mk b/core/main.mk index a616875bf..ef6c684ec 100644 --- a/core/main.mk +++ b/core/main.mk @@ -113,14 +113,17 @@ endif # Check for the correct version of java -java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]') +java_version := $(shell java -version 2>&1 | head -n 1 | grep '^java .*[ "]1\.6[\. "$$]') +ifneq ($(shell java -version 2>&1 | grep -i openjdk),) +java_version := +endif ifeq ($(strip $(java_version)),) $(info ************************************************************) $(info You are attempting to build with the incorrect version) $(info of java.) $(info $(space)) $(info Your version is: $(shell java -version 2>&1 | head -n 1).) -$(info The correct version is: 1.6.) +$(info The correct version is: Java SE 1.6.) $(info $(space)) $(info Please follow the machine setup instructions at) $(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)