Gradle build > PKIX path building failed

Hi,

I am trying to create a Spring Boot application using gradle project. I was able to run java class successfully, but when I have added spring boot dependecy in build.gradle file then I am getting PKIX path building failed error. I have tried various approaches but nothing worked.
I am using jdk 1.8 and spring boot 2.7.10.
Gradle details :-

Gradle version: 8.2
Plugin version: 3.13.4
Request URL: https://scans-in.gradle.com/scans/publish/gradle/3.13.4/token
Request ID: 5d20fa00-e72f-4dea-a26d-cc9063879d5c
Exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

PKIX path building failed

means that there is a problem with establishing a secure HTTPS connection.
This can for example be because you need to use some proxy you did not configure, or some firewall or anti-virus aggressively intervening, or it could also be a broken or bad Java installation with which you run Gradle.

Thank you for responding.
I’ve installed JDK 8 (from Oracle) again and updated both JAVA_HOME and PATH. Could you please provide more details about what you mean by “need to use some proxy you did not configure”?
When I used the latest version of JDK 21 and Spring 3.x.x, it worked seamlessly without any errors. Therefore, it doesn’t appear to be a firewall or antivirus issue. There might be a compatibility concern between Java, Spring, and Gradle, but I’m uncertain as the error seems to be indicating a different direction.

Could you please provide more details about what you mean by “need to use some proxy you did not configure”?

That’s irrelevant if it worked with Java 21.
Maybe the Java 8 you downloaded is missing some essential trusted certificates or similar.
I’d recommend you download instead the latest Java 8 from Adoptium and try with that.