Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How JetBrain IntelliJ IDEA select Java to bootup

I have install Java 8 EA on my Window 7, but it's neither in my %JAVA_HOME% nor in the %PATH%. However when I start my IntelliJ IDEA v12 by clicking idea64.exe, it picked up java 8 EA instead of my Java SDK 1.6.0_32, which is in the %JAVA_HOME% and %PATH%.

Anyone know when IDEA started, how it decide which Java version to run?

like image 364
Gelin Luo Avatar asked Jan 07 '13 00:01

Gelin Luo


People also ask

How do I open Java in IntelliJ?

Start IntelliJ IDE. Go to File -> New -> Project. The below screen appears. Select The Java Project and appropriate Project SDK.


2 Answers

It was picked from the registry.

When launched from .exe IDEA looks for Java in a following order:

  1. IDEA_JDK (or IDEA_JDK_64) environment variable
  2. jre/ (or jre64/) directory in IDEA home
  3. registry
  4. JDK_HOME environment variable
  5. JAVA_HOME environment variable

When launched from .bat the order is same but registry isn't looked, and 64-suffixed vars aren't used (what is probably a bug).

like image 86
Roman Shevchenko Avatar answered Sep 25 '22 17:09

Roman Shevchenko


Here is the available options that you can use for all the different operating systems. If you are interested.

http://intellij-support.jetbrains.com/entries/23455956-Selecting-the-JDK-version-the-IDE-will-run-under

like image 45
dawogfather Avatar answered Sep 24 '22 17:09

dawogfather