Skip to content

JIB Maven not supporting JDK 24 #4397

@atrujillofalcon

Description

@atrujillofalcon

Environment:

Jib version: 3.4.6

Build tool: Maven 3.9.6

OS: Ubuntu 24.04 LTS (Linux amd64)

JDK: Temurin 24.0.1

Description of the issue:

Attempting to build a Java 24 project using jib-maven-plugin fails with:

"Unsupported class file major version 68"

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.4.6:build (default-cli) on project ms-name-restaurants: Execution default-cli of goal com.google.cloud.tools:jib-maven-plugin:3.4.6:build failed: Check the full stace trace, and if the root cause is from ASM ClassReader about unsupported class file version, see https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#i-am-seeing-unsupported-class-file-major-version-when-building: Unsupported class file major version 68 -> [Help 1]

This happens even after updating to the latest version of Jib (3.4.6).
From what I can tell, the underlying ASM version used by Jib doesn't yet support Java 24 bytecode (major version 68), making Jib currently incompatible with projects compiled using Java 24.

Expected behavior:

Jib should support projects compiled with Java 24 (--release 24) and allow building container images with bytecode version 68, provided a compatible base image is used (e.g., eclipse-temurin:24-jre).

Steps to reproduce:

Create a simple HelloWorld.java class using JDK 24.

Configure Maven compiler plugin with <release>24.

Use latest jib-maven-plugin (3.4.6) with a base image supporting Java 24 (eclipse-temurin:24-jre).

Run mvn compile jib:build.

My specific Maven configuration is:

<plugin> <groupId>com.google.cloud.tools</groupId> <artifactId>jib-maven-plugin</artifactId> <version>3.4.6</version> <configuration> <from> <image>openjdk:24-slim</image> </from> <to> <image>xxx/xxx</image> <credHelper>pass</credHelper> </to> <container> <format>OCI</format> </container> </configuration> </plugin>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions