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.
请先登录再写评论。
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.
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.
Well, take a look at the screenshot. Works as expected for me. On a sidenote:
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.)
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.
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.
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
.