When I run my project, I found module is error then I click in found a error \"Warning:No JDK specified for module \'Myproject\'.when run my project.\",vI sett
Run -> Edit configurations -> Select your build configuration -> JRE - change Default to one of actual JDK paths
In Linux I've resolved this by deleting all the folders with names starting as ".AndroidStudio" in my home directory and then rerunning the Android Studio.
ReImport the dependencies if it is a maven project
Restart IntelliJ and reimport the Project and import it as maven. It should work then. The error occurs because IntelliJ keeps track of module through .iml files so any changes in these files can cause this error. Reimporting the project regenerates the .iml file so generally, it solves the error.
it happened for me when I deleted the jdk and installed new one somehow the project kept seeing the old one as invalid but couldn't change, so right click on your module -> Open Module Settings -> and choose Compile Sdk Version.