Reject Google's build of JDK.
Bug: 28097637
(cherry picked from commit 22b23b9b00a3474c95cc314c33aa66a747be13e4)
Change-Id: Ieb809cdd0ba930b9ea65b8b0d31a81be112cc52e
diff --git a/core/main.mk b/core/main.mk
index cc1171a..f9aad2b 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -242,6 +242,12 @@
endif # java version is not Sun Oracle JDK
endif # if requires_openjdk
+KNOWN_INCOMPATIBLE_JAVAC_VERSIONS := google
+incompat_javac := $(foreach v,$(KNOWN_INCOMPATIBLE_JAVAC_VERSIONS),$(findstring $(v),$(javac_version_str)))
+ifneq ($(incompat_javac),)
+javac_version :=
+endif
+
# Check for the correct version of javac
ifeq ($(strip $(javac_version)),)
$(info ************************************************************)
@@ -249,7 +255,12 @@
$(info of javac.)
$(info $(space))
$(info Your version is: $(javac_version_str).)
+ifneq ($(incompat_javac),)
+$(info This '$(incompat_javac)' version is not supported for Android platform builds.)
+$(info Use a publicly available JDK and make sure you have run envsetup.sh / lunch.)
+else
$(info The required version is: $(required_javac_version))
+endif
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)