1

I saw a comment about fixing an issue with the Intellij

"The problem should not occur if you switch Java used by the IntelliJ IDEA from OpenJDK bundled with IDEA to Oracle JVM. At least this can work as a workaround."

How can I change the JVM in Intellij ?

David Mana
  • 111
  • 1
  • 6

2 Answers2

1

Set an environment variable to tell IntelliJ what JVM to use for the IDE.

Go into Control Panel...System...Advanced System Settings. Click the "Advanced" tab, then click the "Environment Variables" button to edit.

Add a new user variable -

"IDEA_JDK" for a 32-bit JVM, or "IDEA_JDK_64" for a 64-bit JVM. Set the variable to point to the directory of the JDK you want IntelliJ to use (e.g., "C:\Java\jdks\1.8x64" or similar)

Restart IntelliJ.

David
  • 962
  • 2
  • 10
  • 29
1

The procedure is described here:

  • Open the Find Action popup using ctrl+shift+A
  • Type switch and select Switch Boot JDK
  • Select an existing JDK in the dropdown (use ... to select a custom path)
  • Reboot the IDE
bertag
  • 417
  • 1
  • 3
  • 10
Bastien Jansen
  • 8,756
  • 2
  • 35
  • 53
  • Great answer that is OS agnostic. – bertag Aug 19 '19 at 18:08
  • How to change it back? IntelliJ hangs at boot time, with OpenJDK 14.0.2 :( – yegor256 Sep 30 '21 at 08:31
  • See the link in my answer: "The path to the selected runtime is stored in the idea.jdk or idea64.jdk file in the IntelliJ IDEA configuration directory. If there are problems with the selected runtime, you can delete this file to revert to the default runtime." – Bastien Jansen Sep 30 '21 at 18:11