
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.

This is not an AI-generated article but is demonstrated by a human on an M1 Mac running IntelliJ IDE.
Please support independent contributors like Code2care by donating a coffee.
Buy me a coffee!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!