You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the issue:
I successfully built my sample project but it crashed upon launch. I figured out that Jib uses the Docker image gcr.io/distroless/java which is based on Java 8. My sample project is based on Java 11.
Expected behavior:
The Maven plugin could choose an image more suited for my project or fail the build with a helpful error message in case a suitable image isn't available.
Log output:
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/example/business/items/ItemResource has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
The text was updated successfully, but these errors were encountered:
Hi @tofflos , thanks for reporting this issue! We are actively working on providing a Java 11 version of distroless (GoogleContainerTools/distroless#236), which will be the default image used for Java 11 projects. In the meantime, I think we should add a warning if a project is using Java >8 @GoogleContainerTools/java-tools
I think we should error out if a project is using Java >8, maybe with a suggestion to use another publicly available base image.
@tofflos for now, I think you can configure Jib to use one of openjdk:11, openjdk:11-slim, openjdk:11-jre, or openjdk:11-jre-slim, for example. (BTW, I don't find alpine versions for 11.)
Description of the issue:
I successfully built my sample project but it crashed upon launch. I figured out that Jib uses the Docker image gcr.io/distroless/java which is based on Java 8. My sample project is based on Java 11.
Expected behavior:
The Maven plugin could choose an image more suited for my project or fail the build with a helpful error message in case a suitable image isn't available.
Steps to reproduce:
Environment:
Windows 10, Maven 3.5.0, OpenJDK 18.9 (build 11+28)
jib-maven-plugin
Configuration:Log output:
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/example/business/items/ItemResource has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
The text was updated successfully, but these errors were encountered: