1

I was trying to create a Spring Boot 3.0.5 application, along with Java 8 in Spring Starter. Screenshot shared below

Spring Starter page

Post which I checked the Explore button which helps in identifying what code will look like.

However, I found

sourceCompatibility = '17'

I did not expect that as I had selected Java 8 in above screen. Am I missing something here?

Explore window

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
ShankPossible
  • 427
  • 4
  • 14
  • No it doesn't, which is also clearly stated in [the documentation](https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html#getting-started.system-requirements) that the minimal requirement is Java17. – M. Deinum Apr 11 '23 at 07:01
  • See e.g. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes. Spring Boot 3 requires Java 17. You can file a bug against https://github.com/spring-io/initializr if it's not there already, anything below Java 17 should be forbidden. I'm curious, though! Why would you start a new project on such an old version of Java? – Petr Janeček Apr 11 '23 at 07:03
  • @PetrJaneček what you said is logical. but which arises the question like, can we run two java versions on a single server machine? – Ramesh Apr 11 '23 at 07:18
  • 2
    @Ramesh Yes, of course. There are some questions and caveats and choices to be made, but you absolutely can run multiple applications on a single machine where each uses a different version of Java. There's even a few different ways to do it. But that's for another question and more internet research. If it turns out to be too much for you, you can always downgrade to Spring Boot 2, or upgrade your other apps to 17. Good luck :). – Petr Janeček Apr 11 '23 at 07:40

2 Answers2

5

No it doesn't. As Spring Boot 3 requires Java 17 or up (as clearly stated in the documentation).

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
0

Spring boot 3 is required Java 17.
You have to use Java 17 if you are going to do with Spring boot 3.

JP Park
  • 21
  • 2