2

I am trying to create a new gradle project in eclipse Due to security reasons, Eclipse cannot download any plugins/software

I get the below error , when i try to create a gradle project,

unable to find valid certification path to requested target Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-bin.zip'.

But I already downloaded the zip file in my local machine, How to add this zip gradle-2.1-bin.zip in eclipse ?

Amira Bedhiafi
  • 8,088
  • 6
  • 24
  • 60
F0cus
  • 585
  • 3
  • 18
  • 52

7 Answers7

11

Try these following steps:

yanike
  • 827
  • 3
  • 13
  • 29
2

Got the Solution from the SO question

Spring STS 3.6.1 and Gradle plugin

Solution is

navigate to Windows->Preferences->Gradle. On the right hand pane , set folder under gradle distribution to path to gradle directory. I set it to "C:\software\gradle-2.6"

F0cus
  • 585
  • 3
  • 18
  • 52
  • Since I wanted to keep the Gradle Wrapper intact, I tried a slightly different approach. I used the command-line to check whether my projects build. This was not the case. After restarting Eclipse (2018-12) this particular error was gone (refreshing the Gradle Project might have helped, too). When I fixed my credentials (the root cause of the problem), everything worked as expected. – Igor May 09 '19 at 10:58
1

I was also facing this issue and resolved it by fixing the build using following steps.

Go to the project home directory. Run the below two commands

 1) gradle wrapper 
 2) .\gradlew build

After these steps are completed, refresh the project in IDE using Gradle > Refresh Gradle Project

0

Try adding your downloaded zip file to .gradle/wrapper/dists/ so it looks like .gradle/wrapper/dists/gradle-2.1-bin

thomasters
  • 183
  • 1
  • 15
  • You will have to restart Eclipse after you have done this. – thomasters Dec 21 '18 at 16:24
  • I had seen the same solution in other SO questions, but here the problem is we are about to create a project. File -> New Project -> Gradle , While creating the project I got this error – F0cus Dec 22 '18 at 11:52
0

While the other answers works, it does not fix the core issue which might come back later. Since I had the same error at work, I think this would help:

The error unable to find valid certification path to requested target indicate that Eclipse failed to access the site using HTTPS because it can't recognize the certificate for various reasons:

  • This might be a self signed certificate (highly doubtful for gradle.org)
  • The CA COMODO ECC Domain Validation Secure Server CA 2 is not valid;

You can check which Root CA is in your trust store using the Java panel: if it is missing, then you get your explanation.

  • You may add it to your trust store using the Java CPL. You need to export the certificate first in your browser.
  • You may add the certificate of the website but I would not recommend it: you will have problems with website using the same CA.
  • You could try to update your JDK to latest JDK8/11, but be wary that Eclipse might not use the JRE/JDK you expect it to use; for that, you'll need to use the -vm launch parameter.
NoDataFound
  • 11,381
  • 33
  • 59
0

Gradle distribution is available over http and https

I have changed wrapper/gradle-wrapper.properties > distributionUrl to be http instead of https and it worked for me.

0

I run into a similar Problem, when I installed a newer version of Eclipse and Gradle on my windows system. The settings have been the same as in my older setup, only older versions and they had no problem.

Turns out, that I there was not enough space left on my GRADLE_USER_HOME dir. Thus I recommend if anybody is facing the same issues, clean your disk space (for me it was c:) or setup gradle repo to another partition.

Knut
  • 136
  • 2
  • 11