7

I installed Gradle from the repository. Then I downloaded Intellij Idea Community Edition from the official website and installed it.

I set the Java JDK and now I am trying to open a Gradle Project, but the problem is that it doesn't accept my Gradle home:

enter image description here

~/Documents/idea-IC-141.2735.5/bin$ whereis gradle
gradle: /usr/bin/gradle /usr/share/gradle /usr/share/man/man1/gradle.1.gz

What's wrong?

Edit: now I can choose the first option Use default gradle wrapper (recommended)

Probably because I restarted, I don't know

4
  • What is IntellIJ says when it doesn't accept ? Any alert or error message. Add this information to your answer because the problem is not obvious from screenshot that you attached Nov 1, 2015 at 10:00
  • You are right, I substituted the screenshot
    – elect
    Nov 1, 2015 at 13:48
  • Did you tried my suggestion? Please give me response on my answer. If it will be unhelpful for you I just remove it. Nov 5, 2015 at 19:35
  • Not yet, RL priorities came in, I'll tell you asap
    – elect
    Nov 9, 2015 at 14:06

1 Answer 1

7

In Gradle home option you need provide path to folder where your Gradle distribution was installed.

To determine the Gradle home location of your Gradle installation:

  1. Create build.gradle containing:

    task getHomeDir << {
        println gradle.gradleHomeDir
    }
    
  2. Run

    gradle getHomeDir
    

Reference: Setting up Gradle Plugin For IntelliJ

5
  • I get 21.26.31: Executing external task 'getHomeDir'... :getHomeDir /home/elect/.gradle/wrapper/dists/gradle-2.2-all/1vevkra640w3rb9hkuw50q5we/gradle-2.2 it seems it falls back using the default gradle wrapper
    – elect
    Nov 23, 2015 at 20:27
  • @elect So anyway did you resolve your problem? Nov 24, 2015 at 19:01
  • 2
    Just by selecting "use default gradle wrapper"..
    – elect
    Nov 24, 2015 at 21:18
  • The step linked works. Just make sure to not have a space at the end. Jul 5, 2017 at 22:36
  • in Gradle 5.4.1 I get error "Could not find method leftShift() for arguments [build_a40fhrzx78ylj5i2p6fgsmqo4$_run_closure3@2ece1ad3] on task ':getHomeDir' of type org.gradle.api.DefaultTask." - it may be resolved by removing the << Jun 3, 2019 at 0:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.