Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring initializr project results in Unsupported class file major version 64

When I create a new project using the Spring initializr Gradle won't build the project. I use IntelliJ IDEA.

The error message is

* Exception is:
org.gradle.cache.CacheOpenException: Could not open init generic class cache for initialization script '/tmp/ijmapper.gradle' (/home/julius/.gradle/caches/7.6.1/scripts/dnnmnny7cynyzgkf00s30jlld).
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:91)
    ... 166+ more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 64

I looked it up using this table, it's java 20. The issue is, that I didn't select Java-20, I chose Java-17. On top of that, I'm not able to install Java-20 on my Linux machine yet.

like image 339
Julius Babies Avatar asked Nov 19 '25 09:11

Julius Babies


1 Answers

I've found the problem: My Gradle settings were trying to use Java 20. I solved it by clicking on Gradle -> the little cogwheel -> Gradle Settings and setting Gradle JVM to 17.

like image 54
Julius Babies Avatar answered Nov 20 '25 21:11

Julius Babies



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!