Skip to content
Advertisement

Why is my spring boot application launching with java 11 although I created it with java 16?

I started a fresh project from https://start.spring.io/ and chose java 16 as a Framework. This is my build.gradle:

enter image description here

I have worked with java 11 and spring boot before so I had Java 11 installed.(I use IntelliJ as my Editor)

In order to start my new project, I upgraded my Java version and updated my Path/Java HOME: enter image description here

I checked my java version:

enter image description here

And I tried a gradle clean/assemble.

Despite doing this, I still get this error when I launch my project:

JavaScript

It seems that spring is still using my old java version. How can I fix this?

Advertisement

Answer

Change the javaversion used by Intellij by doing this:

Go to File > Project Structure and then under Project Settings > Project you will find the option to change your Projects Java Version (If you have other versions installed that is).

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement