Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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):

  • Eclipse: 30s

  • IntelliJ IDEA with Eclipse compiler 45s

  • IntelliJ IDEA with javac compiler: more than 10 minutes (!)

Number of java classes ~5000

like image 680
Neo Avatar asked Jan 16 '14 08:01

Neo


People also ask

Why is IntelliJ slow?

You'll find the memory indicator at the bottom right of your screen. It's also possible to increase the default memory settings for IntelliJ: you can tweak custom VM settings: Afterwards you can specify an amount: If IntelliJ is still slow you can disable any plugins you don't require.

How do I fix a compilation error in IntelliJ?

Invalidate Caches/Restart. Delete user config. Create a new project (trying to see if my current project files somehow all got messed up, but the problems persist even with new projects) Uninstall + Reinstall.

Does IntelliJ automatically compile?

By default, when you run an application, IntelliJ IDEA compiles the module where the classes you are trying to run are located.


2 Answers

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

enter image description here

like image 109
craftsmannadeem Avatar answered Sep 17 '22 08:09

craftsmannadeem


Answer from IntelliJ Support:

Try 13.0.2 from http://confluence.jetbrains.com/display/IDEADEV/IDEA+13+EAP .

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

like image 20
Neo Avatar answered Sep 17 '22 08:09

Neo