From be3a561aac8ddc329dd89429b56b82690fd9a65d Mon Sep 17 00:00:00 2001 From: Ken Sun Date: Mon, 3 Oct 2022 03:12:41 +0000 Subject: [PATCH] Revert "Use the toolchain from JDK 17" Revert submission 2164342-use-jdk17 Reason for revert: DroidMonitor-triggered revert due to breakage b/250426490 Reverted Changes: Ib1a24e7ea:Update path for libjli.so I3375bd4e4:Use the toolchain from JDK 17 I9183e5511:Use the toolchain from JDK 17 Change-Id: I28fc32290dd337b7d44bb98bc52956ee84f01aaa --- java/config/config.go | 7 ++++++- ui/build/config.go | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/java/config/config.go b/java/config/config.go index a84c315d5..ea44aaa08 100644 --- a/java/config/config.go +++ b/java/config/config.go @@ -132,7 +132,12 @@ func init() { if override := ctx.Config().Getenv("OVERRIDE_JLINK_VERSION_NUMBER"); override != "" { return override } - return "17" + switch ctx.Config().Getenv("EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN") { + case "true": + return "17" + default: + return "11" + } }) pctx.SourcePathVariable("JavaToolchain", "${JavaHome}/bin") diff --git a/ui/build/config.go b/ui/build/config.go index 15eea2d53..14a99d080 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -387,13 +387,13 @@ func NewConfig(ctx Context, args ...string) Config { if override, ok := ret.environ.Get("OVERRIDE_ANDROID_JAVA_HOME"); ok { return override } + if ret.environ.IsEnvTrue("EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN") { + return java17Home + } if toolchain11, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN"); ok && toolchain11 != "true" { ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN is no longer supported. An OpenJDK 11 toolchain is now the global default.") } - if toolchain17, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN"); ok && toolchain17 != "true" { - ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN is no longer supported. An OpenJDK 17 toolchain is now the global default.") - } - return java17Home + return java11Home }() absJavaHome := absPath(ctx, javaHome)