IntelliJ — multiple configurations of Java JDK and JRE version in the project that might not align
2 min readOct 13, 2021
Problem Statement
I have a project that managed in VS Code before and start running it in IntelliJ. Even the application properties stated the java version, IntelliJ seems to have some other configuration so that the build (JDK related, I suppose) or the run (JRE related, I suppose) are not using that specified version.
The Configurations
The pom.xml
File > Project Structure > Project
Setting the SDK version, also setting the Project language support to be the same, I choose to use SDK default for Project language level, and in future if I need to change SDK version, this one would keep align.
File > Project Structure > Modules
Choosing language level with project default
File > Settings > Build, Execution, Deployment > Build Tools > Maven > Importing
Setting the JDK for importer to use project JDK, this make the maven to build with proper JDK (I suppose)