0
  1. 1st I was getting the below error while importing a gradle(springboot) project into eclipse,Unable to download the dependencies from https://repo.spring.io

Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

  1. Then I found this and followed the steps mentioned here
  • Downloaded the certificate for https://repo.spring.io in .cer format.
  • Then imported the .cer file into JVM(means to cacerts).

Inside

C:\Program Files (x86)\Java\jre1.8.0_261\security\cacerts

and

C:\Program Files\Java\jdk1.8.0_261\jre\lib\security\cacerts

too using the below command-

keytool -import -alias example -keystore  "C:\Program Files (x86)\Java\jre1.6.0_22\lib\security\cacerts" -file example.cer

But still the same issue persist

  1. Then found this and added the below lines in eclipse.ini file to point to the desired path.
    -vmargs
    -Djavax.net.ssl.trustStore="C:\ProgramFiles\Java\jdk1.8.0_261\jre\lib\security\cacerts"
    -Djavax.net.ssl.trustStorePassword="changeit"

And now while running gradle build(to get the dependencies) I am getting below error

org.apache.http.ssl.SSLInitializationException: "C:\ProgramFiles\Java\jdk1.8.0_261\jre\lib\security\cacerts" (The filename, directory name, or volume label syntax is incorrect)

Can anyone please help with this? Thanks in Advance.

Xwin
  • 103
  • 5
  • 16
  • You misspelled `Program Files` without the space. However, changing files under `Program Files [(x86)]` may not work in recent Windows (since 8 at least) because it is what most viruses and malware does. – dave_thompson_085 Oct 16 '20 at 15:29
  • @dave_thompson_085 Yes, I did like this but got "Error: Could not find or load main class Files\Java\jdk1.8.0_261\jre\lib\security\cacerts" , then removed the space. AND I did the changes for both "Program Files" and "Program Files (x86)". – Xwin Oct 16 '20 at 19:13
  • @dave_thompson_085 I have copied the java folder to a new folder(C:\java\Java\jdk1.8.0_261\jre\lib\security\cacerts , WITHOUT SPACE) and set the Environment Variables accordingly but still I am getting the same error. "The filename, directory name, or volume label syntax is incorrect". – Xwin Oct 17 '20 at 16:25
  • I hadn't noticed, but eclipse.ini although semantically equivalent to the commandline is not actually the commandline, and https://wiki.eclipse.org/Eclipse.ini says "using quotation marks around paths that contain spaces does not seem to work". Possibly using quotation marks does not work at all. Since you now have a path with no space, try that path without the quotation marks. I don't know what you mean by Environment Variables -- nothing here involves any environment variables, nor the Windows control-panel that sets them. -Dxx=yy is a system property, not an envvar. – dave_thompson_085 Oct 19 '20 at 17:50

0 Answers0