Search code examples
mavenmaven-3

OutOfMemory Exception when building Java 8 project IntelliJ, but works fine with Maven


I have a Java 8 project in intellij. When I build the project using Maven (clean compile verify), it works fine. However, when I try to build the project using IntelliJ's "Build Project" feature, I encounter an OutOfMemory Exception.

What could be the cause of this !!!?

I tried to increase the memory for Intelij and also maven but it didn't change anything


Solution

  • Try the following three steps:

    1. Check for Classpath Conflicts and Clean IntelliJ Cache
    2. Switch to Maven Build in IntelliJ
    3. Increase IDE PermGen Space

    PS: Also try deleting the build file, sometimes that's all you need to do :)