Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the JVM used to run IntelliJ on Windows

I have two Java JDKs installed on my workstation, with jdk1.6.0_41 in my path, and jdk1.7.0_21 available as well, but not in the path.

How can I configure IntelliJ IDEA 13 to use a particular JVM? To be clear, I want to set the JVM used to run IntelliJ itself, not the SDK used for running my code. I am running Windows 7 Enterprise Edition and launch IntelliJ 13.0.2 by running idea64.exe

I have set JAVA_HOME to point to jdk1.7.0_21 but according to the About box it is using jdk1.6.0_41.

This FAQ on the JetBrains web site describes how to do this for Mac, but not for Windows.

This answer suggests using the IDEA_JVM environment variable for Ubuntu 12, but I have tried that and it isn't working.

like image 483
Richard Neish Avatar asked Sep 02 '25 02:09

Richard Neish


2 Answers

I suspect you have another setting that is overriding your JAVA_HOME

From Jetbrains docs:

idea64.exe uses this JDK search sequence:

IDEA_JDK_64 environment variable

..\jre64 directory

system Registry

JDK_HOME environment variable

JAVA_HOME environment variable

like image 68
therewillbesnacks Avatar answered Sep 04 '25 23:09

therewillbesnacks


With newer versions the environment variables are ignored. Instead there is a new action "Choose Boot Java Runtime". The easiest way to get to it is via "Find Action" Ctrl+Shift+A.

You can also edit the setting via the .jdk file in your user configuration directory, e.g. %APPDATA%\JetBrains\IntelliJIdea2021.3\idea64.exe.jdk. This is a plain text file containing only the path to the JDK.

It is not recommended to do this, and you should use the JDK that is bundled with IDEA.

like image 39
OrangeDog Avatar answered Sep 04 '25 23:09

OrangeDog