From 5dfa238f224b816753baebdaad36cb06add12073 Mon Sep 17 00:00:00 2001 From: Sorin Basca Date: Mon, 11 Mar 2024 17:23:06 +0000 Subject: [PATCH] Revert^2 "Switch to JDK 21" This reverts commit b832ae19d84132ffe8d780009e772f6602d6b027. Reason for revert: Reland Switch to JDK 21 when related issues are resolved. Bug: 313924276 Change-Id: Ibb5031d9892d1ddc5bc4d2af9885c3192b8ac8ad Test: TH --- java/config/config.go | 7 +------ ui/build/config.go | 13 ++++++------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/java/config/config.go b/java/config/config.go index 6a945ac9c..d720046a1 100644 --- a/java/config/config.go +++ b/java/config/config.go @@ -131,12 +131,7 @@ func init() { if override := ctx.Config().Getenv("OVERRIDE_JLINK_VERSION_NUMBER"); override != "" { return override } - switch ctx.Config().Getenv("EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN") { - case "true": - return "21" - default: - return "17" - } + return "21" }) pctx.SourcePathVariable("JavaToolchain", "${JavaHome}/bin") diff --git a/ui/build/config.go b/ui/build/config.go index e29d23929..a380157c6 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -387,22 +387,21 @@ func NewConfig(ctx Context, args ...string) Config { // Configure Java-related variables, including adding it to $PATH java8Home := filepath.Join("prebuilts/jdk/jdk8", ret.HostPrebuiltTag()) - java17Home := filepath.Join("prebuilts/jdk/jdk17", ret.HostPrebuiltTag()) java21Home := filepath.Join("prebuilts/jdk/jdk21", ret.HostPrebuiltTag()) javaHome := func() string { if override, ok := ret.environ.Get("OVERRIDE_ANDROID_JAVA_HOME"); ok { return override } - if ret.environ.IsEnvTrue("EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN") { - return java21Home - } 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.") + ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN is no longer supported. An OpenJDK 21 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.") + ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK17_TOOLCHAIN is no longer supported. An OpenJDK 21 toolchain is now the global default.") } - return java17Home + if toolchain21, ok := ret.environ.Get("EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN"); ok && toolchain21 != "true" { + ctx.Fatalln("The environment variable EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN is no longer supported. An OpenJDK 21 toolchain is now the global default.") + } + return java21Home }() absJavaHome := absPath(ctx, javaHome)