Using Gradle for minecraft mods

i was watching this video - https://www.youtube.com/watch?v=JFVFqZo5t5Q and at 10:15 he opened up eclipse with gradle using CMD when i tried this an error message came up saying:
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘Stuff’.

Could not resolve all artifacts for configuration ‘:classpath’.
Could not resolve net.minecraftforge.gradle:ForgeGradle:3.+.
Required by:
project :
Failed to list versions for net.minecraftforge.gradle:ForgeGradle.
Unable to load Maven meta-data from https://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/maven-metadata.xml.
Could not get resource ‘https://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/maven-metadata.xml’.
Could not GET ‘https://files.minecraftforge.net/maven/net/minecraftforge/gradle/ForgeGradle/maven-metadata.xml’.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 8s
Please can somebody help me resolve this

Hi,

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

is not really related to Gradle.

It is an error message often seen when the Java Runtime Environment used by the program (Gradle in this case) cannot trust the certificate provided by the remote host. You could update the local CA files to add the missing ones, but this is almost always easier to use a more recent version of the JRE/JDK bundling the necessary CA files. Visit https://jdk.java.net to download a recent version for your operating system.

Most of downloads consist in archives, they do not need to be “installed” unless you want to use another vendor/provider. Packages found on jdk.java.net need only to be extracted somewhere on the disk and several version may be present at the same time. To instruct Gradle to use this or that JDK, add a JAVA_HOME environment variable containing the absolute path to the JDK directory.

Lastly, some software, including Gradle, may not run/build with latest versions of Java. You can download not so old versions in Archived OpenJDK GA Releases if Java 15 is not working for you. Ideally, the author of the software you try to build should provide advice regarding the necessary setup to rebuild it.