使用OpenJDK 7的Minecraft,我得到“ trustAnchors参数必须为非空”


15

我正在使用Ubuntu 15.04和OpenJDK 7,试图运行Minecraft。这就是我得到的。

编辑:当我使用Minecraft时,现在可以使用,sudo java -jar Minecraft.jar但没有超级用户也无法使用,我该如何解决!我不能一直以超级用户身份运行它的原因是因为我希望能够通过在桌面上双击它来运行。

Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma (try 4/10)
Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

运行时。我已经尝试使用OpenJDK 8,它也做到了这一点,我也尝试了Oracle的Java 8。

Minecraft使用OpenJDK 7在旧的14.04笔记本电脑上运行良好。

编辑2:现在,在获得SSL异常后,它启动启动器并说“脱机播放”,所以我转到“启动器日志”选项卡,然后我得到了(对不起,它不是代码格式,因为我无法使其正常工作,请进行编辑!) :

[16:46:39 INFO]: Minecraft Launcher 1.6.11 (through bootstrap 5) started on linux...
[16:46:39 INFO]: Current time is May 25, 2015 4:46:39 PM
[16:46:39 INFO]: System.getProperty('os.name') == 'Linux'
[16:46:39 INFO]: System.getProperty('os.version') == '3.19.0-18-lowlatency'
[16:46:39 INFO]: System.getProperty('os.arch') == 'amd64'
[16:46:39 INFO]: System.getProperty('java.version') == '1.8.0_45-internal'
[16:46:39 INFO]: System.getProperty('java.vendor') == 'Oracle Corporation'
[16:46:39 INFO]: System.getProperty('sun.arch.data.model') == '64'
[16:46:39 INFO]: proxy == DIRECT
[16:46:39 INFO]: Refreshing local version list...
[16:46:39 INFO]: Refreshing remote version list...
[16:46:39 ERROR]: Unexpected exception refreshing version list
javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1937) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1894) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1877) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1398) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1512) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) ~[?:1.8.0_45-internal]
    at com.mojang.launcher.Http.performGet(Http.java:54) ~[launcher.jar:1.6.11]
    at net.minecraft.launcher.updater.RemoteVersionList.getContent(RemoteVersionList.java:27) ~[launcher.jar:1.6.11]
    at net.minecraft.launcher.updater.VersionList.refreshVersions(VersionList.java:85) ~[launcher.jar:1.6.11]
    at net.minecraft.launcher.updater.MinecraftVersionManager.refreshVersions(MinecraftVersionManager.java:60) ~[launcher.jar:1.6.11]
    at net.minecraft.launcher.Launcher$2.run(Launcher.java:132) [launcher.jar:1.6.11]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_45-internal]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_45-internal]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_45-internal]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_45-internal]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45-internal]
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:90) ~[?:1.8.0_45-internal]
    at sun.security.validator.Validator.getInstance(Validator.java:179) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124) ~[?:1.8.0_45-internal]
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1460) ~[?:1.8.0_45-internal]
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:212) ~[?:1.8.0_45-internal]
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) ~[?:1.8.0_45-internal]
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391) ~[?:1.8.0_45-internal]
    ... 16 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200) ~[?:1.8.0_45-internal]
    at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120) ~[?:1.8.0_45-internal]
    at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104) ~[?:1.8.0_45-internal]
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:88) ~[?:1.8.0_45-internal]
    at sun.security.validator.Validator.getInstance(Validator.java:179) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124) ~[?:1.8.0_45-internal]
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1460) ~[?:1.8.0_45-internal]
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:212) ~[?:1.8.0_45-internal]
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) ~[?:1.8.0_45-internal]
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391) ~[?:1.8.0_45-internal]
    ... 16 more
[16:46:40 INFO]: Loaded 2 profile(s); selected 'AsherMaster'
[16:46:40 INFO]: Refreshing auth...
[16:46:40 INFO]: Logging in with access token
[16:46:40 ERROR]: Exception whilst logging into profile
com.mojang.authlib.exceptions.AuthenticationUnavailableException: Cannot contact authentication server
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:71) ~[launcher.jar:1.6.11]
    at com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication.logInWithToken(YggdrasilUserAuthentication.java:132) ~[launcher.jar:1.6.11]
    at com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication.logIn(YggdrasilUserAuthentication.java:55) ~[launcher.jar:1.6.11]
    at net.minecraft.launcher.Launcher.ensureLoggedIn(Launcher.java:214) [launcher.jar:1.6.11]
    at net.minecraft.launcher.Launcher$2.run(Launcher.java:168) [launcher.jar:1.6.11]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_45-internal]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_45-internal]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_45-internal]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_45-internal]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_45-internal]
Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1937) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1894) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1877) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1398) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) ~[?:1.8.0_45-internal]
    at com.mojang.authlib.HttpAuthenticationService.performPostRequest(HttpAuthenticationService.java:73) ~[launcher.jar:1.6.11]
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54) ~[launcher.jar:1.6.11]
    ... 9 more
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:90) ~[?:1.8.0_45-internal]
    at sun.security.validator.Validator.getInstance(Validator.java:179) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124) ~[?:1.8.0_45-internal]
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1460) ~[?:1.8.0_45-internal]
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:212) ~[?:1.8.0_45-internal]
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) ~[?:1.8.0_45-internal]
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) ~[?:1.8.0_45-internal]
    at com.mojang.authlib.HttpAuthenticationService.performPostRequest(HttpAuthenticationService.java:73) ~[launcher.jar:1.6.11]
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54) ~[launcher.jar:1.6.11]
    ... 9 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200) ~[?:1.8.0_45-internal]
    at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120) ~[?:1.8.0_45-internal]
    at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104) ~[?:1.8.0_45-internal]
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:88) ~[?:1.8.0_45-internal]
    at sun.security.validator.Validator.getInstance(Validator.java:179) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184) ~[?:1.8.0_45-internal]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124) ~[?:1.8.0_45-internal]
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1460) ~[?:1.8.0_45-internal]
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:212) ~[?:1.8.0_45-internal]
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) ~[?:1.8.0_45-internal]
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391) ~[?:1.8.0_45-internal]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1282) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1257) ~[?:1.8.0_45-internal]
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) ~[?:1.8.0_45-internal]
    at com.mojang.authlib.HttpAuthenticationService.performPostRequest(HttpAuthenticationService.java:73) ~[launcher.jar:1.6.11]
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:54) ~[launcher.jar:1.6.11]
    ... 9 more

是的,请。我需要整个消息。
AB:

请进入您的Minecraft启动器,然后打开启动器日志标签。复制所有消息,编辑您的问题并添加这些消息。
AB

作为超级用户?那真是个坏主意。
AB

移动文件夹并更正权限。
AB

打开一个终端和火命令:sudo mv /root/.minecraft ~/.minecraft。而命令sudo chown -R $USER:$USER ~/.minecraft
AB

Answers:


34

实际上,更好的答案是在命令提示符下输入以下内容。

sudo update-ca-certificates -f

thx,它也对我有帮助=)
Alexander Logger

1
这也有助于将我的Maven设置修复为15.10
Kalle

对我来说,这也是解决方法。。。谢谢!
菲利普

这对我也有帮助,我在ubuntu服务器上安装了OpenJDK8(尝试),并试图运行一个将OAuth用于Twitter的Java应用程序,并且出现此错误,并且由于已经安装了ca-certificates-java而感到非常困惑。运行此命令后,一切正常!
mgrandi

我也可以确认这也对我有用。我在尝试从RackSpace托管实例读取播客URL时遇到了此错误,并且此命令对其进行了修复。
克莱·弗格森

5

打开一个终端并触发以下命令:

sudo apt-get install --reinstall ca-certificates-java

并确保系统时间设置正确。

资源

我引用:

基本上,Minecraft使用SSL保护您的登录名,但Java没有验证所需的证书。Minecraft启动器确实应该给出更好的错误消息,但这确实是Ubuntu的错。您需要ca-certificates-java安装该软件包,但是在我的Ubuntu安装中,它已损坏。尝试做ls /etc/ssl/certs/java/cacerts。如果缺少它,则需要从朋友或其他Unix计算机上复制它。您不想从陌生人那里复制安全文件…


尝试此操作后,同样的错误消息是我的“时间设置”,只是系统时间,因为那是正确的。同时做ls / etc / ssl / certs / java / cacerts
也不

3

在没有其他人为我工作之后,我终于找到了解决方案。在错误报告的底部,我发现了以下神奇的命令系列:

sudo dpkg --purge --force-depends ca-certificates-java

接着:

sudo apt-get install ca-certificates-java

这立即为我解决了问题。


1
这在Kubuntu 18.04上对我有用。
布兰登

1

我刚刚解决了!这是修复Minecraft中所有SSL错误的方法。

  1. 您需要另一台Linux计算机的“证书”文件,因此在另一台Linux PC上运行以下命令:

    readlink -f /usr/bin/java | sed "s:bin/java::"

    然后去那条路(类似/usr/lib/jvm/java-8-openjdk-amd64/jre/)。

  2. 打开“ lib”文件夹,然后打开“ security”文件夹。
  3. 复制“证书”文件。
  4. 在计算机上再次运行该命令,然后转到该路径:

    readlink -f /usr/bin/java | sed "s:bin/java::"
    • 如果您在编辑内容时遇到麻烦,则需要使用打开“文件” sudo -H nautilus
  5. 打开“ lib”,然后再次“安全”。
  6. 将“ cacerts”文件替换为另一台PC上的文件。

如果在另一台PC上找不到“ cacerts”文件,请检查此路径,/etc/ssl/certs/java/然后应该会看到cacerts。我不能保证这个工作。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.