3

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

我从以下链接获取文件:

Java 加密扩展 (JCE) 无限强度管辖策略文件 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)
4

2 回答 2

2

您应该将以下内容添加到eclipse.ini的vmargs部分

-Djava.security.egd=/dev/random
于 2016-03-17T14:52:24.353 回答
1

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

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

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

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

于 2018-10-17T14:59:42.403 回答