Project JDK is not defined [IntelliJ IDEA]


Error - Project JDK is not defined
Error - Project JDK is not defined

If you get the message - "Project JDK is not defined" on IntelliJ IDEA when trying to run your Java (Android) code then you have not set your JDK with the IDE,

Solution:

Simply click on "Setup JDK" (you will see it at the right side of the message line) and select the JDK that are available - "JDK 8" in my case, once you select a JDK, indexing may take up some time and you should see a green check sign.

You should now be able to Build and Run Java code.