繁体   English   中英

启用Java安全性后,Eclipse崩溃(Java Cryptography Extension - JCE)

[英]Eclipse is crashing after enabling java security (Java Cryptography Extension - JCE)

启用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)

您应该将以下内容添加到eclipse.inivmargs部分

-Djava.security.egd=/dev/random

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

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM