From 46e00ea4ba3cddfd9792b501d30d95d93828dd66 Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Thu, 16 Oct 2014 10:23:03 +0100 Subject: [PATCH] Remove Java 6 build support Change-Id: I9754844af58e3f81d7eb9dae286128d17a2cb56c --- core/combo/javac.mk | 4 ---- core/config.mk | 10 ---------- core/main.mk | 13 +------------ envsetup.sh | 29 +++++++++-------------------- 4 files changed, 10 insertions(+), 46 deletions(-) diff --git a/core/combo/javac.mk b/core/combo/javac.mk index 7f91aa9dd..fb43ea44e 100644 --- a/core/combo/javac.mk +++ b/core/combo/javac.mk @@ -9,11 +9,7 @@ # COMMON_JAVAC -- Java compiler command with common arguments # -ifneq ($(LEGACY_USE_JAVA6),) -common_jdk_flags := -target 1.5 -Xmaxerrs 9999999 -else common_jdk_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999 -endif # Use the indexer wrapper to index the codebase instead of the javac compiler ifeq ($(ALTERNATE_JAVAC),) diff --git a/core/config.mk b/core/config.mk index d0743f467..c030d22b6 100644 --- a/core/config.mk +++ b/core/config.mk @@ -418,17 +418,7 @@ else COLUMN:= column endif -ifeq ($(HOST_OS),darwin) -ifeq ($(LEGACY_USE_JAVA6),) HOST_JDK_TOOLS_JAR:= $(shell $(BUILD_SYSTEM)/find-jdk-tools-jar.sh) -else -# Deliberately set to blank for Java 6 installations on MacOS. These -# versions allegedly use a non-standard directory structure. -HOST_JDK_TOOLS_JAR := -endif -else -HOST_JDK_TOOLS_JAR:= $(shell $(BUILD_SYSTEM)/find-jdk-tools-jar.sh) -endif ifneq ($(HOST_JDK_TOOLS_JAR),) ifeq ($(wildcard $(HOST_JDK_TOOLS_JAR)),) diff --git a/core/main.mk b/core/main.mk index 1958a1674..b628c8fb5 100644 --- a/core/main.mk +++ b/core/main.mk @@ -139,19 +139,11 @@ endif 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 correct version of java, should be 1.7 by -# default, and 1.6 if LEGACY_USE_JAVA6 is set. -ifeq ($(LEGACY_USE_JAVA6),) +# Check for the correct version of java. required_version := "1.7.x" required_javac_version := "1.7" java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.7[\. "$$]') javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.7[\. "$$]') -else # if LEGACY_USE_JAVA6 -required_version := "1.6.x" -required_javac_version := "1.6" -java_version := $(shell echo '$(java_version_str)' | grep '^java .*[ "]1\.6[\. "$$]') -javac_version := $(shell echo '$(javac_version_str)' | grep '[ "]1\.6[\. "$$]') -endif # if LEGACY_USE_JAVA6 ifeq ($(strip $(java_version)),) $(info ************************************************************) @@ -170,13 +162,10 @@ endif # Check for the current JDK. # # For Java 1.7, we require OpenJDK on linux and Oracle JDK on Mac OS. -# For Java 1.6, we require Oracle for all host OSes. requires_openjdk := false -ifeq ($(LEGACY_USE_JAVA6),) ifeq ($(HOST_OS), linux) requires_openjdk := true endif -endif # Check for the current jdk diff --git a/envsetup.sh b/envsetup.sh index c29b7881b..18bc97201 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -1390,7 +1390,7 @@ function godir () { \cd $T/$pathname } -# Force JAVA_HOME to point to java 1.7 or java 1.6 if it isn't already set. +# Force JAVA_HOME to point to java 1.7 if it isn't already set. # # Note that the MacOS path for java 1.7 includes a minor revision number (sigh). # For some reason, installing the JDK doesn't make it show up in the @@ -1407,25 +1407,14 @@ function set_java_home() { fi if [ ! "$JAVA_HOME" ]; then - if [ -n "$LEGACY_USE_JAVA6" ]; then - case `uname -s` in - Darwin) - export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home - ;; - *) - export JAVA_HOME=/usr/lib/jvm/java-6-sun - ;; - esac - else - case `uname -s` in - Darwin) - export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) - ;; - *) - export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 - ;; - esac - fi + case `uname -s` in + Darwin) + export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) + ;; + *) + export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 + ;; + esac # Keep track of the fact that we set JAVA_HOME ourselves, so that # we can change it on the next envsetup.sh, if required.