Open robinroos opened 2 days ago
Hi Robin,
The 17
in the JKube version has nothing to do with the supported Java version.
We've been supporting Java 21 almost since the LTS version of Java was released.
However, in case your project is not compatible with Java 21, we still maintain a Java 17 image (https://quay.io/repository/jkube/jkube-java-17 / https://github.com/eclipse-jkube/jkube-images/blob/70378958e9aac35963545c52f6c1d3bb192cbefb/jkube-java-17.yaml).
You can switch to use this image just by adding the following property in your Java project:
<jkube.generator.from>quay.io/jkube/jkube-java-17</jkube.generator.from>
That should solve your problem.
Related:
Thanks for that.
We chose the alternative approach and I am expediting our adoption of Java 21.
Describe the bug
We use JKube 1.13.1 targeting Java 17 runtime platform deployment to Open Shift.
When we tried to adopt JKube 1.17.0 the build process worked but the base image seemed to carry with it a Java 21 edition of java.util.
Here are the notes I took:
jkube 1.17.0
oc: spring-boot: Using Docker image quay.io/jkube/jkube-java:0.0.24 as base / builder
application runtime:
2024-10-21 16:00:38.876 ERROR o.g.a.w.WeavingClassFileTransformer - error weaving java/util/WeakHashMap$HashIterator: Unsupported class file major version 65 java.lang.IllegalArgumentException: Unsupported class file major version 65
jkube 1.13.1
build log:
oc: spring-boot: Using Docker image quay.io/jkube/jkube-java:0.0.19 as base / builder
application runtime:
No Exceptions.
Eclipse JKube version
1.17.0
Component
OpenShift Maven Plugin
Apache Maven version
3.6.3
Gradle version
None
Steps to reproduce
Expected behavior
Java 17 base image should not contain Java 21 bytecode.
Runtime
OpenShift
Kubernetes API Server version
1.25.3
Environment
Linux
Eclipse JKube Logs
Sample Reproducer Project
I will happily work with you on this as required but cannot submit a reproducer project at this time.
Additional context
Works fine wit JKube 1.13.1, fails at runtime with JKube 1.17.0-generated deployment:
2024-10-21 16:00:38.876 ERROR o.g.a.w.WeavingClassFileTransformer - error weaving java/util/WeakHashMap$HashIterator: Unsupported class file major version 65 java.lang.IllegalArgumentException: Unsupported class file major version 65