Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in thread "main" java.lang.UnsupportedClassVersionError ... #1353

Closed
AAdewunmi opened this issue Nov 28, 2022 · 4 comments
Closed

Comments

@AAdewunmi
Copy link

Hi,

I created a new SpringBoot project in SpringToolSuite4 and selected Java 11 as the perfered JDK.

Screenshot 2022-11-28 at 09 09 40

However, Spring Initializr overrode my selection and created the project using Java 17.

Screenshot 2022-11-28 at 09 12 16

Running the project produces the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/springframework/boot/SpringApplication has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

Screenshot 2022-11-28 at 09 23 56

Overriding selected JDK; Is this a bug?

@wilkinsona
Copy link
Contributor

Spring Boot 3 requires Java 17. Please check the generated project's HELP.md file for details.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2022
@AAdewunmi AAdewunmi changed the title Exception in thread "main" java.lang.UnsupportedClassVersionError -> SpringToolSuite4 Exception in thread "main" java.lang.UnsupportedClassVersionError ... Nov 28, 2022
@AAdewunmi
Copy link
Author

@wilkinsona thanks!

However, it would make sense to remove Java 19 / 11 / 8 from the UI, so users know Java 17 is the default.

Screenshot 2022-11-28 at 10 29 27

@wilkinsona
Copy link
Contributor

They can't be removed as they're supported with other versions of Spring Boot. spring-io/start.spring.io#250 is tracking some improvements in this area.

@AAdewunmi
Copy link
Author

Ok 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants