Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javax.net.ssl.SSLException-trustAnchors参数必须为非空_Java_Gradle_Openssl_Openssl Engine - Fatal编程技术网

javax.net.ssl.SSLException-trustAnchors参数必须为非空

javax.net.ssl.SSLException-trustAnchors参数必须为非空,java,gradle,openssl,openssl-engine,Java,Gradle,Openssl,Openssl Engine,当我尝试运行/gradlew run时,我不断得到: Downloading https://services.gradle.org/distributions/gradle-4.4.1-bin.zip Exception in thread "main" javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterExcepti

当我尝试运行
/gradlew run
时,我不断得到:

Downloading https://services.gradle.org/distributions/gradle-4.4.1-bin.zip

Exception in thread "main" javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
尝试
curl-vhttps://services.gradle.org/distributions/gradle-4.4.1-bin.zip
而且效果很好

Connected to services.gradle.org (2400:cb00:2048:1::6810:aba6)
successfully set certificate verify locations:
CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs

您没有提到您正在使用哪个JDK或OS/distro,但有可能
ca证书java
在Oracle JDK/JRE中不是依赖项,因此必须显式安装

你可能需要跑步

sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure
另见

我在Ubuntu MATE 17.10上使用oracle-8-jdk,尝试了你的命令,但仍然出现错误。@Gavriil你解决过这个问题吗?你找到了答案吗。我现在很关心这个问题。