Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting JAVA_HOME for intelliJ?

So i decided to try the beta of android studio today, but it refuses to run on my 32-bit JRE. I can download the 64-bit JRE, but im not interested in it being my default JRE for various reasons (my current 32-bit eclipse IDE, Processing IDE and Minecraft doesn't like 64-bit to my experiences), and i think that swithing java_home dir all the time will be cumbersome.

So does intelliJ have some way of setting an alternative JAVA_HOME dir like eclipse does in its ini?

like image 533
EJTH Avatar asked Jun 29 '13 10:06

EJTH


People also ask

Does JAVA_HOME point to JRE or JDK?

JAVA_HOME is an operating system (OS) environment variable which can optionally be set after either the Java Development Kit (JDK) or the Java Runtime Environment (JRE) is installed. The JAVA_HOME environment variable points to the file system location where the JDK or JRE was installed.

How can I set JAVA_HOME path?

To set JAVA_HOME, do the following: Right click My Computer and select Properties. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.


1 Answers

In IntelliJ you can specify which SDK to use at project level. go to "File" --> "Project Structure" --> SDKs (list on the left) and you can add/remove paths to different SDKs

Other solution: If you use Windows then I think you can specify JAVA_HOME as system property just for IntelliJ. If you use Linux the solution is similar.

like image 194
morgano Avatar answered Sep 18 '22 01:09

morgano