javamacosintellij-ideaclasspath

Setting up IntelliJ IDEA with Java 1.8/1.7 and resolve "java: System Java Compiler was not found in classpath"


Let's make the long story short. Here is what happened:

  1. IntelliJ 12 CE downloaded and installed
  2. Latest Java 1.7/1.8 downloaded and installed
  3. JDK was setup to make and run the project

I faced the following strange error:

Error: java: System Java Compiler was not found in classpath

This was despite of the fact that I had Java 1.7/1.8 fully installed and had no problems working with it through the terminal.


Solution

  • The solution that fixed my problem was as follows:

    In:

    Project Settings > Compiler > Java Compiler

    I changed the drop down Use compiler from Javac to Eclipse!

    Non of the other solutions I found on the web was helpful. Hope this helps you my unknown fellow reader.

    IMPORTANT: THIS HAD NOTHING TO DO WITH MY JAVA_HOME AS IT WAS SET CORRECTLY.