docker6
This is a classic "Enterprise Migration Trap." You are caught between a Legacy Runtime (Java 8) and a Modern Toolchain (Sonar/Tekton) that requires a higher version of Java to execute its own analy...

Source: DEV Community
This is a classic "Enterprise Migration Trap." You are caught between a Legacy Runtime (Java 8) and a Modern Toolchain (Sonar/Tekton) that requires a higher version of Java to execute its own analysis logic. Since you cannot migrate the actual source code to Java 21 yet, but the pipeline forces Java 21 for the Sonar step, you have three primary strategies to bypass the BASE64Decoder and JAXB compilation errors. Strategy 1: Decouple Compilation from Analysis (Recommended) SonarQube does not actually require Java 21 to compile your code; it only needs Java 17+ to run the scanner. You can tell Gradle to use a Java 8 Toolchain for the compilation/test tasks while letting the pipeline environment stay on Java 21. Add this to your build.gradle: java { toolchain { languageVersion = JavaLanguageVersion.of(8) } } Why this works: Even if the Tekton agent is running on JDK 21, Gradle will automatically download (or use a provided) JDK 8 to compile your sun.misc code. The Sonar task will then run