idea Error:java: JDK isn‘t specified for module ‘XXXX‘

Right click the project in idea, select project structure, open modules, and select dependencies

Select the module SDK below as Java version.


Read More: