I am trying to import a Gradle project into IntelliJ, and when I get to the Gradle Home
textbox, it is not automatically populated, nor will typing in the path of Gradle Home
result in a valid location - I have the GRADLE_USER_HOME
environment variable set (to what I think is!) the correct path, and I have been able to successfully import this same project into Eclipse. Any suggestions?
Open Preferences -> Build, Execution, Deployment -> Gradle . Select Use local gradle distribution and specify Gradle home .
The default Gradle user home directory is $USER_HOME/. gradle . A property defined in the properties file, in the Gradle user home directory, overrides the property values defined in a properties file in the project directory.
Otherwise, from the main menu, select File | New | Project from Existing Sources. In the dialog that opens, select the directory in which your sources, libraries, and other assets are located and click Open. Gradle or Android Gradle: select the necessary build tool and click Finish.
You can write a simple gradle script to print your GRADLE_HOME
directory.
task getHomeDir { doLast { println gradle.gradleHomeDir } }
and name it build.gradle
.
Then run it with:
gradle getHomeDir
If you installed with homebrew, use brew info gradle
to find the base path (i.e. /usr/local/Cellar/gradle/1.10/
), and just append libexec
.
The same task in Kotlin in case you use build.gradle.kts
:
tasks.register("getHomeDir") { println("Gradle home dir: ${gradle.gradleHomeDir}") }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With