From f4906a95c9f3ac93e103ec4255170aa3ebce0127 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Thu, 23 Jun 2022 16:20:46 +0300 Subject: [PATCH] Default to Java17-based builder-images for native executable generation This makes the use of java17-based builder-images the default without taking into account JVM version used to build the project. The motivation for this change is that the builder-image compiles bytecode to binary files and in theory a Java17-based builder-image should be able to compile Java bytecode generated by a Java11 compiler and produce a native executable that behaves the same as a native executable generated by a Java11-based builder-image. A key difference between a native executable generated by a Java11-based builder-image and a native executable generated by a Java17-based builder-image is that they include (embedded in the native executable) different implementations of the JDK standard libraries. In theory this should not be an issue, given that Java is backwards compatible and the Java11 APIs of the standard libraries should still be implemented and respected in Java17. This change will allow us to test this hypothesis in practice as well :) --- .../deployment/pkg/steps/NativeImageBuildContainerRunner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildContainerRunner.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildContainerRunner.java index dfa908100fad0..e597b2c9b31a1 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildContainerRunner.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildContainerRunner.java @@ -39,7 +39,8 @@ public NativeImageBuildContainerRunner(NativeConfig nativeConfig, Path outputDir outputPath = outputDir == null ? null : outputDir.toAbsolutePath().toString(); containerName = "build-native-" + RandomStringUtils.random(5, true, false); - this.needJava17Image = javaVersion.isExactlyJava11() == CompiledJavaVersionBuildItem.JavaVersion.Status.FALSE; + // Default to using java17 builder images + this.needJava17Image = true; } @Override