Using a 64-bit Java compiler in IDEA 13

We have a fairly large Java codebase (roughly 20 K classes) that we are in the process of moving to Java 7. With a compiler heap size of 1 GB the project Ant script builds this system in 7 minutes using the 32-bit compiler. Attempting to compile from IDEA using the 32-bit javac with 1 GB, the build fails after over 40 minutes with an out-of-memory exception.

Various searches have turned up no way to run IDEA 13 with a 64-bit compiler process and, of course, attempting to allocate more than 1 GB to the 32-bit compiler fails. Is there a way to cause IDEA to use the 64-bit compiler? I realize that this will likely require an even larger heap allocation, but I would like to try it.

7 comments
Comment actions Permalink

Hmm... I had similar problem (generating classes from quite complex set of XSDs using XMLBeans) and all I had to do is to start IDEA in x64 mode (idea64.exe with IDEA_JDK pointing to JDK x64). Then I was able to allocate more memory for compiler (and maven runner) and it solved my problem.

0
Comment actions Permalink

This is not what I see. Regardless of whether I start IDEA with idea.exe or idea64.exe, and regiardless of the setting of IDEA_JDK or IDEA_JDK_64 (both of which I've seen documented in various JetBrains posts), a 32-bit process is always started for the compiler.

0
Comment actions Permalink

Well, take a look at the screenshot. Works as expected for me. On a sidenote:

  • I've set IDEA_JDK (not IDEA_JDK_64), but I don't think it makes the difference for the compiler process
  • I have JAVA_HOME set to JDK 1.6 x64 (not sure if it makes the difference)
  • My project uses JDK 1.6 x64 - maybe that's what you need to do (if your project is still linked to JDK x86)

compiler.png

0
Comment actions Permalink

This JetBrains support document says that idea64.exe looks first in the directory specified by the environment variable IDEA_JDK_64. That may be. But IDEA still starts a 32-bit compiler process. (I happen to have JDK 7 installs for both architectures on my machine. I haven't yet experimented to see what would happen if I didn't have a 32-bit JDK on my machine.)

0
Comment actions Permalink

I have both (x86 and x64) versions of JDK 1.6 and 1.7 installed, so I guess there's still something incorrect in your configuration. As you can see on the screenshot I have no problem running x64 compiler and I don't really remember having any issues when setting that up. Actually it would be good to have "official" feedback on what's required to run IDEA's make with x64 compiler.

0
Comment actions Permalink

I have no doubt that there is something wrong with my configuration. But I'm doing what's (not very well) documented and it's not working. That's why I'm asking.

0
Comment actions Permalink

Hi,

the compiler process is not specified by environment variables. The variable IDEA_JDK just specifies under which JDK IDEA itself is started. For your project you have to specify a Project SDK.
Go to "File" - "Project Structure" (ctrl-alt-shift-s) and configure a project sdk

.

sdk.png

0

Please sign in to leave a comment.