Gradlew not working properly

I am new to gradle, and have installed gradle:

uhaq$ gradle -v

Welcome to Gradle 6.4!

Here are the highlights of this release:

  • Support for building, testing and running Java Modules
  • Precompiled script plugins for Groovy DSL
  • Single dependency lock file per project

For more details see https://docs.gradle.org/6.4/release-notes.html


Gradle 6.4

Build time: 2020-05-05 19:18:55 UTC
Revision: 42f7c3d0c3066b7b38bd0726760d4881e86fd19f

Kotlin: 1.3.71
Groovy: 2.5.10
Ant: Apache Antâ„¢ version 1.10.7 compiled on September 1 2019
JVM: 1.8.0_144 (Oracle Corporation 25.144-b01)
OS: Mac OS X 10.13.6 x86_64

I am trying to do this:

**/gradlew build -x test**
``
But getting ssl error:
./gradlew build -x test
Downloading https://services.gradle.org/distributions/gradle-6.4-all.zip

Exception in thread "main" 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
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1959)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)

Any help is greatly appreciated!