IDEA uses the native java environment

idea has its own jre in its installation package.

idea uses its own jre by default

If you want to use your own jdk, you can find idea.bat in bin directory

:: ---------------------------------------------------------------------
:: Locate a JDK installation directory which will be used to run the IDE.
:: Try (in order): IDEA_JDK, idea%BITS%.exe.jdk, ..\jre, JDK_HOME, JAVA_HOME.
:: ---------------------------------------------------------------------
SET JDK=

IF EXIST "%IDEA_JDK%" SET JDK=%IDEA_JDK%
IF EXIST "%JDK%" GOTO check

SET BITS=64
SET USER_JDK64_FILE=%USERPROFILE%\.IntelliJIdea2018.3\config\idea%BITS%.exe.jdk
SET BITS=
SET USER_JDK_FILE=%USERPROFILE%\.IntelliJIdea2018.3\config\idea%BITS%.exe.jdk
IF EXIST "%USER_JDK64_FILE%" (
  SET /P JDK=<%USER_JDK64_FILE%
) ELSE (
  IF EXIST "%USER_JDK_FILE%" SET /P JDK=<%USER_JDK_FILE%
)
IF NOT "%JDK%" == "" (
  IF NOT EXIST "%JDK%" SET JDK="%IDE_HOME%\%JDK%"
  IF EXIST "%JDK%" GOTO check
)

IF EXIST "%IDE_HOME%\jre64" SET JDK=%IDE_HOME%\jre64
IF EXIST "%JDK%" GOTO check
IF EXIST "%IDE_HOME%\jre32" SET JDK=%IDE_HOME%\jre32
IF EXIST "%JDK%" GOTO check
IF EXIST "%IDE_HOME%\jre" SET JDK=%IDE_HOME%\jre
IF EXIST "%JDK%" GOTO check

IF EXIST "%JDK_HOME%" SET JDK=%JDK_HOME%
IF EXIST "%JDK%" GOTO check

IF EXIST "%JAVA_HOME%" SET JDK=%JAVA_HOME%

When setting up the jdk,

  1. Take the environment variable idea? JDK
  2. idea%BITS%.exe.jdk (this is in this directory,% USERPROFILE%.IntelliJIdea2018.3\config\idea%BITS%.exe.jdk)
  3. .. / jre (that is, jre provided by idea)
  4. Environment variable JDK? Home
  5. Environment variable Java? Home

As you can see, Java home is the last choice

I see. The configuration mode is convenient to use

You can configure the environment variable of idea? JDK to specify the Java environment,

You can also change Java home to Article 1.

Of course, the first one is recommended. This is the way that idea reserves for us to configure jdk environment.

This is where idea is easier to use than eclipse, with details everywhere.

eclipse can only rely on local Java. idea can be configured freely.

OK, it's over!

Keywords: Programming JDK Java Eclipse

Added by rreynier on Wed, 06 Nov 2019 17:14:01 +0200