【问题标题】:Eclipse is crashing after enabling java security (Java Cryptography Extension - JCE)启用 java 安全性后 Eclipse 崩溃(Java Cryptography Extension - JCE)
【发布时间】:2016-07-03 23:51:04
【问题描述】:

Eclipse 在启用 java 安全性后崩溃。我已将 local_policy.jar 和 US_export_policy.jar 添加到 jre/lib/security 文件夹中。

我从以下链接获取文件:

Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 :http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

Debug options:
file:/Users/jkuria/soft/eclipse_downloads/eclipse 2/Eclipse.app/Contents/MacOS/.options not found
org.osgi.framework.BundleException: Error initializing container.
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:93)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:209)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:201)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:168)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:296)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: java.lang.ExceptionInInitializerError
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.initWorker(EquinoxBundle.java:137)
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:83)
... 12 more
Caused by: java.security.ProviderException: setSeed() failed
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:458)
at sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:329)
at sun.security.provider.NativePRNG.engineSetSeed(NativePRNG.java:212)
at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:209)
at java.security.SecureRandom.<init>(SecureRandom.java:190)
at org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.computeNodeAddress(UniversalUniqueIdentifier.java:127)
at org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.<clinit>(UniversalUniqueIdentifier.java:35)
... 14 more
Caused by: java.io.IOException: Operation not permitted
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:313)
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:456)

【问题讨论】:

    标签: java eclipse jce java-security


    【解决方案1】:

    使用/dev/random 可能会导致Java 应用程序启动延迟,因为/dev/random 会阻塞,直到生成大量熵。

    一般而言,/dev/urandom 将是一个性能更高且同样安全的随机源。由于 Java 的特性,vmarg 实际上看起来像:

    -Djava.security.egd=file:/dev/./urandom
    

    但是,我不清楚为什么需要此属性。接受的答案有效,但没有说明原因。我很想知道异常的原因。

    【讨论】:

      【解决方案2】:

      您应该将以下内容添加到 eclipse.ini

      vmargs 部分
      -Djava.security.egd=/dev/random
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-10-20
        • 2011-06-30
        • 1970-01-01
        • 2013-11-07
        • 2013-04-16
        • 2013-10-08
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多