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?
相关问题
- Could not read entry … from cache taskArtifacts.bi
- Configure gradle plugin based on future tasks
- Configure gradle plugin based on future tasks
- How to fix the error Cannot change strategy of con
- How to make available “open this project in Intell
相关文章
- In IntelliJ IDEA, how can I create a key binding t
- Android BuildConfig Field generating String incorr
- IntelliJ IDEA can't open projects or add SDK o
- IntelliJ Subversion Authentication Required Dialog
- Gradle Could not find method “() for arguments on
- Gradle Custom Plugin: gradleApi() vs Explicit Depe
- Android Studio 3.5 ERROR: Unable to resolve depend
- How to specify @category in test task in gradle?
\Android studio\gradle didn't worked for me.
And "Default gradle wrapper" wasn't configured while importing (cloning) the project from bitbucket
If you installed gradle with homebrew, then the path is:
Where X.X is the version of gradle (currently 2.1)
You can write a simple gradle script to print your
GRADLE_HOME
directory.and name it
build.gradle
.Then run it with:
If you installed with homebrew, use
brew info gradle
to find the base path (i.e./usr/local/Cellar/gradle/1.10/
), and just appendlibexec
.This is what helped me solve the problem of not having Gradle home set for the IDEA when importing a Gradle project.
THREE OPTIONS -- (A) Default Wrapper (B) "gradle 'wrapper' task configuration" OR (C) "local gradle distribution" defined by jetbrains: https://www.jetbrains.com/help/idea/gradle-settings.html
A. Default Wrapper (recommended)
B. Gradle 'Wrapper' Task Configuration
If you want IDEA to define your gradle version for you from your build script
Example below from jetbrains: https://www.jetbrains.com/help/idea/gradle-settings.html
(useful if you do not want to share gradle builds between projects)
C. Local Gradle Distribution
This is because "libexec is to be used by other daemons and system utilities executed by other programs" (i.e. IDEA). Please see https://unix.stackexchange.com/questions/312146/what-is-the-purpose-of-usr-libexec
I had some weird errors where it could not find my class, I had to right click on my src folder (was red) to "Make Directory as" -> Source Folder Root
AFAIK it is GRADLE_HOME not GRADLE_USER_HOME (see gradle installation http://www.gradle.org/installation).
On the other hand I played a bit with Gradle support in Idea 13 Cardea and I think the gradle home is not automatically discover by Idea. If so you can file a issue in youtrack.
Also, if you use gradle 1.6+ you can use the Graldle support for setting the build and wrapper. I think idea automatically discover the wrapper based gradle project.
$ gradle setupBuild --type java-library
$ gradle wrapper
Note: Supported library types: basic, maven, java
Regards