Neo
Neo

Reputation: 1377

IntelliJ IDEA: the first compilation takes a lot of time

I'm using IntelliJ IDEA to develop my Java application. I'm frustrated with the fact that the first compilation of a project (or a complete rebuild) takes very long, about 15 min (and is very CPU-intensive). The project is composed from a couple of hundreds of Java classes, but compiling it with Eclipse just need 1-2 minutes.

Are there any compilation options that I can set in order to speed up this step?

UPDATE

My configuration: SSD, 64GB RAM, Xeon E5-1660, Win 7 Ultimate

Compilation time (Rebuild):

Number of java classes ~5000

Upvotes: 15

Views: 12202

Answers (5)

Neo
Neo

Reputation: 1377

Answer from IntelliJ Support:

Disable the option to clean output directories on rebuild in the compiler settings.

Upvotes: 4

craftsmannadeem
craftsmannadeem

Reputation: 2973

Change the following setting (Build process heap size) to some large value

enter image description here

Upvotes: 9

user508434
user508434

Reputation:

You can also increase the heap size in the file Intellij IDEA\bin\idea.exe.vmoptions. For example try these (assuming you have a lot of RAM):

-Xmx6g
-Xms6g
-XX:MaxPermSize=512m
-ea
-server
-XX:+UseConcMarkSweepGC

Having done this, you need to start idea with idea64.exe because the default 32bit version will not be able to use the big ram.

Upvotes: 2

Harald K
Harald K

Reputation: 27113

You can use the Eclipse compiler from IntelliJ IDEA.

Enable the Eclipse compiler from Settings -> Compiler -> Java Compiler: "Use compiler:" (change from Javac to Eclipse).

update: Here's my compilation times for a full rebuild, using IntelliJ IDEA 13 on a fairly large project:

Using javac 1.7.0_45 to compile java sources
Compilation completed successfully with 60 warnings in 27 sec

Using eclipse compiler to compile java sources
Compilation completed successfully with 652 warnings in 26 sec

So there seems to be something strange with your setup.

Upvotes: 4

opi
opi

Reputation: 244

  1. We put our projects on a SSD drive and this speed up the IDEA rebuild significantly (about half the time).
  2. I don't think you are comparing the same thing IDEA <-> eclipse somehow eclipse must have done some work already in the background or has a cache somewhere but I don't know eclipse well.

Upvotes: 1

Related Questions