Downloading by version
The DSL extension offers a download
method to configure a JavaLanguageVersion
.
The plugin infers the matching Jextract version from that defined Java version.
It downloads and installs Jextract from the official release page for the current build platform.
Use Java toolchain (highly recommended)
Section titled “Use Java toolchain (highly recommended)”By convention, the plugin tries to get the Java version from the configured Java toolchain. This is by far the most convenient and reliable method for most projects.
java { toolchain { languageVersion = JavaLanguageVersion.of(24) }}
java { toolchain { languageVersion = JavaLanguageVersion.of 24 }}
Use another version
Section titled “Use another version”Setting an explicit version in the DSL will override the convention, and the Java toolchain will be ignored. This might make sense if no Java plugin is used in the build, or if the version should diverge from the target JVM.
jextract.download(JavaLanguageVersion.of(21))
jextract.download(JavaLanguageVersion.of(21))