gpt4 book ai didi

java - Eclipse 安装程序 : can not initialize cryptographic mechanism

转载 作者:太空宇宙 更新时间:2023-11-03 13:00:25 30 4
gpt4 key购买 nike

我的计算机上安装了 OpenJDK 9,我正在尝试安装 Eclipse。但是,每次启动安装程序时都会出现错误:

Internal Error: Cannot initialize cryptographic mechanism

Details: java.lang.ExceptionInInitializerError
at java.base/javax.crypto.JceSecurityManager.<clinit>(JceSecurityManager.java:66)
at java.base/javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2610)
at java.base/javax.crypto.Cipher.getMaxAllowedKeyLength(Cipher.java:2634)
at java.base/sun.security.ssl.CipherSuite$BulkCipher.isUnlimited(CipherSuite.java:602)
at java.base/sun.security.ssl.CipherSuite$BulkCipher.<init>(CipherSuite.java:574)
at java.base/sun.security.ssl.CipherSuite$BulkCipher.<clinit>(CipherSuite.java:460)
at java.base/sun.security.ssl.CipherSuite.<clinit>(CipherSuite.java:1074)
at java.base/sun.security.ssl.SSLContextImpl.getApplicableSupportedCipherSuiteList(SSLContextImpl.java:354)
at java.base/sun.security.ssl.SSLContextImpl.access$100(SSLContextImpl.java:42)
at java.base/sun.security.ssl.SSLContextImpl$AbstractTLSContext.<clinit>(SSLContextImpl.java:590)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:292)
at java.base/java.security.Provider$Service.getImplClass(Provider.java:1844)
at java.base/java.security.Provider$Service.newInstance(Provider.java:1820)
at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
at java.base/javax.net.ssl.SSLContext.getInstance(SSLContext.java:169)
at java.base/javax.net.ssl.SSLContext.getDefault(SSLContext.java:99)
at org.apache.http.conn.ssl.SSLContexts.createSystemDefault(SSLContexts.java:78)
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransferFactory.newInstance(HttpClientRetrieveFileTransferFactory.java:27)
at org.eclipse.ecf.internal.provider.filetransfer.Activator.getFileTransfer(Activator.java:608)
at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:92)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$InputStreamConnectionHandler.sendConnectionRequest(ECFURIHandlerImpl.java:1641)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$ConnectionHandler.process(ECFURIHandlerImpl.java:1392)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl.createInputStream(ECFURIHandlerImpl.java:303)
at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.handleArchiveRedirection(SetupCoreUtil.java:549)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.configureResourceSet(SetupCoreUtil.java:348)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.configureResourceSet(SetupCoreUtil.java:174)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.createResourceSet(SetupCoreUtil.java:168)
at org.eclipse.oomph.setup.ui.wizards.SetupWizard.<init>(SetupWizard.java:167)
at org.eclipse.oomph.setup.ui.wizards.SetupWizard.<init>(SetupWizard.java:159)
at org.eclipse.oomph.setup.internal.installer.Installer.<init>(Installer.java:40)
at org.eclipse.oomph.setup.internal.installer.InstallerApplication.run(InstallerApplication.java:222)
at org.eclipse.oomph.setup.internal.installer.InstallerApplication.start(InstallerApplication.java:408)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:547)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Caused by: java.lang.SecurityException: Can not initialize cryptographic mechanism
at java.base/javax.crypto.JceSecurity.<clinit>(JceSecurity.java:118)
... 49 more
Caused by: java.lang.SecurityException: Can't read cryptographic policy directory: unlimited
at java.base/javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:324)
at java.base/javax.crypto.JceSecurity.access$000(JceSecurity.java:73)
at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:109)
at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:106)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/javax.crypto.JceSecurity.<clinit>(JceSecurity.java:105)
... 49 more

然后它给了我更新的选项:

This is an emergency update: Contiune?

点yes后出现这个错误:

Could not initialize class sun.security.ssl.SSLContextImpl$DefaultSSLContext

Details: java.lang.reflect.InvocationTargetException
at org.eclipse.oomph.setup.internal.installer.InstallerApplication$6$2.run(InstallerApplication.java:484)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$DefaultSSLContext
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:292)
at java.base/java.security.Provider$Service.getImplClass(Provider.java:1844)
at java.base/java.security.Provider$Service.newInstance(Provider.java:1820)
at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
at java.base/javax.net.ssl.SSLContext.getInstance(SSLContext.java:169)
at java.base/javax.net.ssl.SSLContext.getDefault(SSLContext.java:99)
at org.apache.http.conn.ssl.SSLContexts.createSystemDefault(SSLContexts.java:78)
at org.eclipse.ecf.provider.filetransfer.httpclient4.HttpClientRetrieveFileTransferFactory.newInstance(HttpClientRetrieveFileTransferFactory.java:27)
at org.eclipse.ecf.internal.provider.filetransfer.Activator.getFileTransfer(Activator.java:608)
at org.eclipse.ecf.provider.filetransfer.retrieve.MultiProtocolRetrieveAdapter.sendRetrieveRequest(MultiProtocolRetrieveAdapter.java:92)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$InputStreamConnectionHandler.sendConnectionRequest(ECFURIHandlerImpl.java:1641)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl$ConnectionHandler.process(ECFURIHandlerImpl.java:1392)
at org.eclipse.oomph.setup.internal.core.util.ECFURIHandlerImpl.createInputStream(ECFURIHandlerImpl.java:303)
at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.handleArchiveRedirection(SetupCoreUtil.java:549)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.configureResourceSet(SetupCoreUtil.java:348)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.configureResourceSet(SetupCoreUtil.java:174)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.createResourceSet(SetupCoreUtil.java:168)
at org.eclipse.oomph.setup.ui.SelfCommitContext.changeRepositoryIfNeeded(SelfCommitContext.java:113)
at org.eclipse.oomph.setup.ui.SelfCommitContext.migrateProfile(SelfCommitContext.java:80)
at org.eclipse.oomph.setup.internal.installer.SelfUpdate.resolve(SelfUpdate.java:127)
at org.eclipse.oomph.setup.internal.installer.InstallerApplication$6$2.run(InstallerApplication.java:465)
... 1 more

最后,这条信息出现了:

JVM terminated. Exit code=1 /usr/bin/java -Xms256M -Xmx1024M -jar /home/george/Downloads/eclipse-installer//plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar -os linux -ws gtk -arch x86_64 -showsplash -launcher /home/george/Downloads/eclipse-installer/eclipse-inst -name Eclipse Installer --launcher.library /home/george/Downloads/eclipse-installer//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.500.v20170531-1133/eclipse_1624.so -startup /home/george/Downloads/eclipse-installer//plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar --launcher.appendVmargs -exitdata 770005 -data @noDefault -vm /usr/bin/java -vmargs -Xms256M -Xmx1024M -jar /home/george/Downloads/eclipse-installer//plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar

有什么方法可以解决此问题以便我可以安装 eclipse?

最佳答案

我一直在努力解决一个非常相似的问题并找到了解决方案(您的问题有相同的原因并且可以用相同的方式解决)。在带有 JDK 9 的 Ubuntu 17.04 上安装 Eclipse 后,我在启动时收到以下错误:Loading available Gradle versions has encountered a problem and Details button reveals this error:

An internal error occurred during: "Loading available Gradle versions".
Could not initialize class sun.security.ssl.SSLContextImpl$DefaultSSLContext

稍后在使用 Eclipse 时可能会遇到相关错误。

正如我在 looking very similar problem in docker 之后发现的那样,问题出在Ubuntu 17.04 JDK安装(build 9-Ubuntu+0-9b161-1)里面没有/conf目录。这应该在 Ubuntu 17.10 中较新的 JDK 构建中得到修复。

到目前为止,您有 2 个选项可以自行解决此问题:

  1. (简单方法,使用符号链接(symbolic link)伪造 conf 目录):在 JDK 9 目录中创建符号链接(symbolic link)(对我来说是 /usr/lib/jvm/default-java) 使用以下命令:sudo ln -sn lib conf由于安全策略文件在/lib 下,这解决了问题。

  2. (更复杂,通过在适当的/conf 目录下安装替代 JDK 来解决问题):从 Oracle 下载 JDK 9 并安装到某个任意文件夹;然后将此文件夹添加到 PATH(例如在 .bashrc 中);然后在/etc/environment 中把 JAVA_HOME 改成这个文件夹

关于java - Eclipse 安装程序 : can not initialize cryptographic mechanism,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45494304/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com