[Java] java | idea | The jdk version of the terminal in idea is inconsistent with the jdk version in cmd

1. Description

        1. Multiple jdk versions are installed locally, jdk7, jdk8, jdk11

        2. According to different projects, it is necessary to switch the version of JAVA_HOME from time to time

        3. There is a project that is 1.8, Project Structure... is changed to 1.8; Setting.Java Compiler is changed to 1.8; the result is that the terminal is still open jdk11 (annoying)

Two, solve

1. In idea, keyboard shortcuts

Ctrl + N

~~

2. Select Actions and search for Switch Boot Jdk

Switch Boot Jdk

3. Select the required version and restart idea

 4. If it still doesn't work, turn off IDEA; delete IDEA's cache

C:\Users\HUAWEI\.IntelliJIdea2019.2\system

Instruction 1: Delete the system folder

Note 2: HUAWEI is the computer name

Note 3: After deleting, restart IDEA; then execute [2. Select Actions, and search for Switch Boot Jdk] [3. Select the required version, and restart idea]

~~

Guess you like

Origin blog.csdn.net/myloverisxin/article/details/130555732