From a194197852eee789e721ade407eae5f9423d1276 Mon Sep 17 00:00:00 2001 From: Alexey Ushakov Date: Fri, 11 Mar 2016 08:34:03 +0300 Subject: [PATCH] IDEA-149864 Switch boot JDK on Windows shouldn't appear since unavailable Updated idea.bat to handle bundled jdk --- bin/scripts/win/idea.bat | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/scripts/win/idea.bat b/bin/scripts/win/idea.bat index 272051336291..6ef406ccc23c 100644 --- a/bin/scripts/win/idea.bat +++ b/bin/scripts/win/idea.bat @@ -6,12 +6,18 @@ :: --------------------------------------------------------------------- :: Locate a JDK installation directory which will be used to run the IDE. -:: Try (in order): @@product_uc@@_JDK, ..\jre, JDK_HOME, JAVA_HOME. +:: Try (in order): @@product_uc@@_JDK, @@vm_options@@.jdk, ..\jre, JDK_HOME, JAVA_HOME. :: --------------------------------------------------------------------- IF EXIST "%@@product_uc@@_JDK%" SET JDK=%@@product_uc@@_JDK% IF NOT "%JDK%" == "" GOTO jdk SET USER_JDK_FILE=%USERPROFILE%\.@@system_selector@@\config\@@vm_options@@.jdk -IF EXIST "%USER_JDK_FILE%" set/pJDK=<%USER_JDK_FILE% +IF EXIST "%USER_JDK_FILE%" SET/pJDK=<%USER_JDK_FILE% +IF "%JDK%" == "" GOTO jdk0 +IF EXIST "%JDK%" GOTO jdk +SET JDK=%~dp0\..\%JDK% +GOTO jdk + +:jdk0 IF NOT "%JDK%" == "" GOTO jdk IF EXIST "%~dp0\..\jre" SET JDK=%~dp0\..\jre IF NOT "%JDK%" == "" GOTO jdk