Wednesday, October 19, 2011

Running IDEA on Windows 64bit JVM

For reasons unknown the Windows download for IntelliJ IDEA defaults to running in a 32bit JRE that comes as part of the distribution. This is particularly annoying on Windows since the 32bit JVM is limited to roughly a gigabyte and a half of heap space.

To run IDEA with an arbitrary JVM the "JDK_HOME" environment variable needs to be set (not "JAVA_HOME"). Then IDEA can be started with the "idea.bat" file in the "bin" directory of the installation.

By default the batch file will leave an extra console window around. This can be avoided by (a) changing from the java.exe executable to the javaw.exe (just add that extra w where the JAVA_EXE is configured) and (b) adding the "start" command in front of the actual call to java.

Note that start assumes that the first quoted parameter is a window name, not a command. That means you need one more quoted parameter in front with arbitrary content. The full line in my file (IDEA 10.5.2) looks like this:

start "" "%JAVA_EXE%" %JVM_ARGS% -cp "%CLASS_PATH%" %IDEA_MAIN_CLASS_NAME% %*

3 comments:

Rathinam said...

Excellent article and i like your great posts. I want more info from this blog...
Unix Training in Chennai
Best Unix Training in Chennai
Excel Training in Chennai
Oracle DBA Training in Chennai
Spark Training in Chennai
Oracle Training in Chennai
Graphic Design Courses in Chennai
Power BI Training in Chennai
Pega Training in Chennai

Jackie Co Kad said...

The article explains how to run IntelliJ IDEA on a Windows 64-bit JVM instead of the 32-bit JRE included with the Windows distribution. The 32-bit JVM is described as having a heap-space limitation of roughly 1.5 GB, which can be problematic when working with larger development environments. The solution involves configuring IDEA to use an arbitrary JVM through the JDK_HOME environment variable.

To configure the JVM, the article specifies that JDK_HOME should be set rather than JAVA_HOME. IDEA can then be started using the idea.bat file located in the installation's bin directory. This configuration is particularly relevant when working with Java development environments and applications covered in a Java Full Stack Developer Course.

Jackie Co Kad said...

The article also explains how to prevent the batch file from leaving an additional console window open. The suggested changes are to use javaw.exe instead of java.exe and place the start command before the Java invocation. Because Windows start treats the first quoted argument as a window title, an additional quoted parameter is required. The resulting command uses start "", the configured Java executable, JVM arguments, class path, and IDEA main class to launch the development environment through the JAX-RS ReactJS Full Stack Developer Course ecosystem.