In this post, we will see how to change java version in intellij.
Steps to change java version in intellij IDEA
Here are steps to change java version in Intellij
idea.
- Go to
File
->Project Structure
If you prefer keyboard shortcuts:
Windows
: Ctrl + Shift + Alt + SMac
: CMD + ;
Following pop up will be displayed in intellij.
- Navigate to
Project Setting
->SDK
and add JDK.If you have already configured JDK, then select the JDK.
- Go to
Project Settings
->Project
and changeProject SDK
andProject language level
to previously added java versionOnce you change the JDK version, project will start reindexing its source files and libraries to ensure all JDK features are in sync.
- Naviage to
Project Settings
->Project
and change
💡 Did you know?
Please note that when you change java version in intellij, it will only be used by intellij. If you run the java program via command line, then it will use
JAVA_HOME
java version.It won’t also change JVM used by build tools such as maven or gradle.
That’s all about how to change java version in intellij.