Skip to content

Commit

Permalink
Default to Java17-based builder-images for native executable generation
Browse files Browse the repository at this point in the history
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 :)
  • Loading branch information
zakkak committed Jun 23, 2022
1 parent 99b8b41 commit f4906a9
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -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
Expand Down

0 comments on commit f4906a9

Please sign in to comment.