I have been having trouble getting my maven build to run. The issue seems to be I have some mismatching versions in but havene't been able to figure it out. Do I need to lower the JRE or install an older Maven?
Asked
Active
Viewed 62 times
-2
-
1**Neither**. You need to raise the JRE to work with the version of **Spring** you are trying to use. – Elliott Frisch Dec 24 '22 at 14:32
-
@ElliottFrisch I added the maven version and it shows it is running JRE19 – number01 Dec 24 '22 at 15:25
-
Your [error message](https://stackoverflow.com/questions/9170832/list-of-java-class-file-format-major-version-numbers) says you're using JRE16 (Class version 60 is Java 16). – Elliott Frisch Dec 24 '22 at 15:43
-
Spring Boot 3 requires Java 17 (class version 61), you're using Java 16 (class version 60). And please, don't post screenshots of textual information like console output, post it as code formatted text. In all likelyhood, your JAVA_HOME environment variable points to a Java 16 install. – Mark Rotteveel Dec 25 '22 at 18:00
1 Answers
-1
The error message suggests that you have used higher version of spring boot maven plugin (RepackageMojoj.java) which is compiled with JDK 17.
Possible fix: Reducing that to the version compatible with your installed JDK should fix this issue.
Also, It seems that your project is not being built by the maven version that you have shared in the 2nd screenshot.

Sandeep Kumar
- 1
- 2
-
The class comes from Spring Boot 3 which is built for Java 17, so reducing that isn't possible (apart from going back to Spring Boot 2.7). The project needs to target Java 17 or higher. – Rob Spoor Dec 24 '22 at 16:58
-
Could you try using maven wrapper with JAVA_HOME set as JDK 17 ? – Sandeep Kumar Dec 26 '22 at 06:39