The solution for JAVA_HOME not defined yet problem while importing existing Gradle project during the first setup of IntelliJ.

If you have a problem with importing Gradle project for the first time, you need to go to starting screen, select Configure -> Project Defaults -> Project Structure and add new SDK (pointing to JDK folder on your computer)

After that, you should be able to import your Gradle project.

Please follow and like my blog:
Author