From abbcddaaf430d1dbdcfcdc84a927ded5206d58b0 Mon Sep 17 00:00:00 2001 From: Pete Gillin Date: Mon, 28 Oct 2019 16:15:33 +0000 Subject: [PATCH] Switch to an OpenJDK 11 toolchain by default. Prior to this change, the default was to use and OpenJDK 9 toolchain, with the EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN=true environment variable available to opt into OpenJDK 11. After this change, the default is to use OpenJDK 11, with EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN=false available to opt out. This change affects: - The version of javac used. - The version of javadoc used. - The version of other tools used during the build process (e.g. jar, jmod, and jlink). - For Java bytecode executed on the host, the version of the java executable used, and so the versions of the JVM and the OpenJDK libraries in the system module (or bootclasspath). This change does not affect: - The Java language level, i.e. the version of Java expected in source code (the -source option to javac) or the version of Java bytecode produced (the -target option to javac). - Anything to do with code execution on the device. Bug: 131683177 Test: make java droid docs cts tests Test: zcat out/verbose.log.gz | grep 'prebuilts/jdk/jdk[0-9]*' Test: make RunBluetoothRoboTests RunCarSettingsLibRoboTests Test: cts-tradefed help Test: atest CtsHostTzDataTests Test: atest CtsLibcoreTestCases Change-Id: I09dc22f1af4d1f2d7d3b85c08cb0ed9a1105aaca Merged-In: Iaae89ef25c92ec099575c026fc50e41da4e143e8 --- java/config/config.go | 6 +++--- ui/build/config.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/java/config/config.go b/java/config/config.go index f418ee7f9..1c5596165 100644 --- a/java/config/config.go +++ b/java/config/config.go @@ -88,10 +88,10 @@ func init() { }) pctx.VariableFunc("JlinkVersion", func(ctx android.PackageVarContext) string { switch ctx.Config().Getenv("EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN") { - case "true": - return "11" - default: + case "false": return "9" + default: + return "11" } }) diff --git a/ui/build/config.go b/ui/build/config.go index 919b9ce83..686ca3e76 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -219,10 +219,10 @@ func NewConfig(ctx Context, args ...string) Config { if override, ok := ret.environ.Get("OVERRIDE_ANDROID_JAVA_HOME"); ok { return override } - if toolchain11, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN"); ok && toolchain11 == "true" { - return java11Home + if toolchain9, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN"); ok && toolchain9 == "false" { + return java9Home } - return java9Home + return java11Home }() absJavaHome := absPath(ctx, javaHome)