back to all blogsSee all blog posts

Java Toolchains in Liberty Build Plugins in 26.0.0.2

image of author
Navaneeth S Nair on Feb 24, 2026
Post available in languages:

This release introduces Java Toolchains support, enabling developers to decouple the JDK used to run build tools from the JDK used to run the Liberty server.

In Open Liberty 26.0.0.2:

View the list of fixed bugs in 26.0.0.2.

Develop and run your apps using 26.0.0.2

If you’re using Maven, include the following in your pom.xml file:

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <version>3.12.0</version>
</plugin>

Or for Gradle, include the following in your build.gradle file:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'io.openliberty.tools:liberty-gradle-plugin:3.10.0'
    }
}
apply plugin: 'liberty'

Or if you’re using container images:

FROM icr.io/appcafe/open-liberty

Or take a look at our Downloads page.

If you’re using IntelliJ IDEA, Visual Studio Code or Eclipse IDE, you can also take advantage of our open source Liberty developer tools to enable effective development, testing, debugging and application management all from within your IDE.

Ask a question on Stack Overflow

Java Toolchains in Liberty Build Plugins

In the latest release of the Liberty build plugins, support has been added for Java Toolchains. This enhancement enables developers to decouple the JDK used to run their build tools (Maven or Gradle) from the JDK used to run the Liberty server and their applications. This provides greater flexibility and environmental consistency.

Java Toolchains support

The Liberty build plugins now support the standard Java Toolchain mechanism. Previously, Liberty plugins were restricted to using the same Java version that was running Maven or Gradle. This prevented developers from using more recent JDK versions for their build process if their applications required a specific older JDK version.

With Java Toolchains, you can now run your build tool on a modern JDK (for example, Java 25). At the same time, Liberty servers and all server operations can execute using a different, configured JDK (for example, Java 8).

Maven Plugin integration

The Liberty Maven plugin now integrates seamlessly with the maven-toolchain-plugin. To use this feature, define your available JDKs in your ~/.m2/toolchains.xml file. The plugin automatically detects and uses the toolchain that is specified in your project’s pom.xml file. The Liberty Maven Plugin now integrates seamlessly with the maven-toolchain-plugin as of version 3.12.0. To use this feature, define your available JDKs in your ~/.m2/toolchains.xml file and then configure <jdkToolchain> tag in <configuration>.

The plugin automatically detects and uses the toolchain specified in your project’s pom.xml file. For detailed configuration steps and parameters, see the Liberty Maven Plugin Toolchain documentation.

The plugin acknowledges the JDK vendor and version constraints that are defined in your Maven profiles, helping to ensure that your server environment remains consistent across different developer machines and CI/CD pipelines.

Gradle Plugin integration

The Liberty Gradle plugin now recognizes the native java { toolchain { …​ } } configuration block as of version 3.10.0. This configuration provides a unified way to manage Java versions across multi-project builds, where different services might have different runtime requirements.

For detailed configuration steps and parameters, see the Liberty Gradle Plugin Toolchain documentation.

When a toolchain is configured in your build.gradle, the Liberty plugin uses that specific Java runtime for all server-related tasks (for example, libertyDev and libertyStart).

Try it now

To start using Java Toolchains, update your build tools to the latest versions of the Liberty Maven or Gradle plugins.

For Maven:

<plugin>
    <groupId>io.openliberty.tools</groupId>
    <artifactId>liberty-maven-plugin</artifactId>
    <version>3.12.0</version>
    <configuration>
        <jdkToolchain>
            <version>11</version>
            <!-- Optional: include vendor if you need to distinguish between toolchains -->
             <!-- <vendor>ibm</vendor> -->
        </jdkToolchain>
    </configuration>
</plugin>

For Gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'io.openliberty.tools:liberty-gradle-plugin:3.10.0'
    }
}
apply plugin: 'liberty'


java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
        // Optional: specify vendor
        // vendor = JvmVendorSpec.ADOPTIUM
    }
}

Notable bugs fixed in this release

Get Open Liberty 26.0.0.2 now