Antonio Roque
Antonio Roque

Reputation: 315

error importing gradle project into eclipse

It´s my first time with gradle , I´m trying to import a gradle project into my Eclipse .

Eclipse Java EE IDE for Web Developers. Version: Photon Release (4.8.0) Build id: 20180619-1200 OS: Windows 10, v.10.0, x86_64 / win32 Java version: 1.8.0_181

using import "Existing Gradle Project" ..I´m getting a error on the

org.gradle.tooling.BuildException: Could not fetch model of type 'GradleBuild' using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.3-bin.zip'.

...... Caused by: org.gradle.internal.exceptions.LocationAwareException: Build file 'C:\WorkArea\os_temp\build.gradle' line: 14

line: 14 --> props.load(new FileInputStream("build.properties")) ....

Caused by: java.io.FileNotFoundException: build.properties (The system cannot find the file specified)

the build.properties is there in the root folder of the project that I´m trying to import

this is the project that i´m trying to import https://github.com/krishagni/openspecimen

thank you Roque

Upvotes: 1

Views: 9199

Answers (3)

Sandeep Amarnath
Sandeep Amarnath

Reputation: 6917

  1. Comment or temporarily remove the content in build.gradle file/files.
  2. Delete .project and .classpath files in the folder you're importing (if any exists).
  3. Override workspace settings and set it to Gradle wrapper
  4. Specify Gradle user home (bin folder of gradle) and Java home jdk folder and click Next.
  5. This solved my problem. If it doesn't work for you then try different options like setting Local installation directory for gradle and so on.
  6. Once this works, you can put the content back to your build.gradle files and try again so that you know which line in build.gradle file causes the issue.

Note: The import might fail for other reasons as well which might need a different troubleshooting. This worked for me though.

enter image description here

Upvotes: 0

jfk
jfk

Reputation: 5287

Try with this option during import enter image description here

Upvotes: 0

Viet Nguyen
Viet Nguyen

Reputation: 21

I got the same issues for gradle-5.3.1, but while importing the project:

  • I've changed "Local Installation Directory" to C:\gradle-5.3.1
  • and "Gradle User Home" to the C:\gradle-5.3.1\bin and after this the project imported successfully, it solved my problem.

I hope this helps in your case.

See my configure in pic

Upvotes: 2

Related Questions