An exception occurred while executing the Java class. Unsupported major.minor version 68.0
I am testing graalvm espresso.
I created a vanilla java program, which can be compiled and ran without a problem. However, when attempting to manage the project using maven (v.3.9.11), mvn throws
An exception occurred while executing the Java class. Unsupported major.minor version 68.0
.
I know its version mismatched error. So I add related fields with version 24 such as maven.compiler.source
, maven.compiler.target
, source
, target
to pom.xml as below. But the problem remains. What's the correct fields or version value to specify for pinning the jdk source and target version? Or anything that I also need to configure or miss? Thanks.
11 Replies
ā
This post has been reserved for your question.
Hey @everymen! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
The versioning scheme more looks like the latest supported JDK version of your GraalVM runtime is 21.
Yep, that's it. While GraalVM website says it would be "GraalVM for JDK 24 (Latest)" when I try to run a file compiled with JDK 22 I get a
LinkageError
with UnsupportedClassVersionError
.Their runtime is espresso and not GraalVM directly
espresso is a different JVM
but idk whether espresso for JDK 24 is supposed to be supported with GraalVM for JDK 21
I think that's because you are compiling it with JDK 21 (GraalVM) and you would only use espresso for running your application but not compiling (idk whether that's supported). Nothing in your pom.xml specifies that you are actually using espresso for anything other than a dependency basically
but yes, trying to use GraalVM for JDK 24 is probably still a good idea
I downloaded from here so I tested with Espresso 24: https://www.graalvm.org/latest/reference-manual/espresso/
Espresso
ā¦
GraalVM is an advanced JDK with ahead-of-time Native Image compilation.
So?
this is espresso for JDK 24 I think
even though espresso itself is running on JDK 21
but yes I generally wouldn't run espresso for applications using a Java version not designated as LTS by Oracle
For me it even explicitly prints
So idk where the 24 comes into play actually.
seems like that one espresso version is espresso for JDK 24 but actually running on JDK 24
š¤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
Thanks for the input. I will try if there exists v24 version, not v21. Thanks again for the advice!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@1225316541067825183>.