Implicitly bump up Java target to 1.8

Bug: 320294595
Test: m
Change-Id: I693e564c67d17254d68f3a9c16664c1da93b9488
This commit is contained in:
Sorin Basca
2024-01-15 16:38:46 +00:00
parent 1c4cc3d40e
commit d567a514ee
2 changed files with 13 additions and 9 deletions

View File

@@ -564,9 +564,11 @@ const (
func (v javaVersion) String() string {
switch v {
case JAVA_VERSION_6:
return "1.6"
// Java version 1.6 no longer supported, bumping to 1.8
return "1.8"
case JAVA_VERSION_7:
return "1.7"
// Java version 1.7 no longer supported, bumping to 1.8
return "1.8"
case JAVA_VERSION_8:
return "1.8"
case JAVA_VERSION_9:
@@ -583,10 +585,12 @@ func (v javaVersion) String() string {
func (v javaVersion) StringForKotlinc() string {
// $ ./external/kotlinc/bin/kotlinc -jvm-target foo
// error: unknown JVM target version: foo
// Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 16, 17
// Supported versions: 1.8, 9, 10, 11, 12, 13, 14, 15, 16, 17
switch v {
case JAVA_VERSION_6:
return "1.8"
case JAVA_VERSION_7:
return "1.6"
return "1.8"
case JAVA_VERSION_9:
return "9"
default:
@@ -602,9 +606,11 @@ func (v javaVersion) usesJavaModules() bool {
func normalizeJavaVersion(ctx android.BaseModuleContext, javaVersion string) javaVersion {
switch javaVersion {
case "1.6", "6":
return JAVA_VERSION_6
// Java version 1.6 no longer supported, bumping to 1.8
return JAVA_VERSION_8
case "1.7", "7":
return JAVA_VERSION_7
// Java version 1.7 no longer supported, bumping to 1.8
return JAVA_VERSION_8
case "1.8", "8":
return JAVA_VERSION_8
case "1.9", "9":