ubuntu Eclipse 启动提示internal error:SHA-a not avaliable 和eclipse默认root启动

 

 

Eclipse 启动提示internal error:SHA-a not avaliable 和eclipse默认root启动


 

今天准备在Ubuntu下搭建Eclipse开发环境,下载好相应的软件并解压到相应的目录。在启动时却出现如下错误:

查看命令行日志,(使用命令行启动即可看到相应的信息):

[plain] view plain copy

  1. An exception occurred while writing to the platform log:  

  2. java.lang.NullPointerException  

  3.     at org.eclipse.equinox.launcher.Main.openLogFile(Main.java:2559)  

  4.     at org.eclipse.equinox.launcher.Main.log(Main.java:2392)  

  5.     at org.eclipse.equinox.launcher.Main.run(Main.java:1461)  

  6.     at org.eclipse.equinox.launcher.Main.main(Main.java:1426)  

  7. Logging to the console instead.  

  8. !ENTRY org.eclipse.equinox.launcher 4 0 2014-06-01 00:30:05.824  

  9. !MESSAGE Exception launching the Eclipse Platform:  

  10. An exception occurred while writing to the platform log:  

  11. java.lang.NullPointerException  

  12.     at org.eclipse.equinox.launcher.Main.openLogFile(Main.java:2559)  

  13.     at org.eclipse.equinox.launcher.Main.log(Main.java:2392)  

  14.     at org.eclipse.equinox.launcher.Main.run(Main.java:1462)  

  15.     at org.eclipse.equinox.launcher.Main.main(Main.java:1426)  

  16. Logging to the console instead.  

  17. !STACK  

  18. java.lang.InternalError: internal error: SHA-1 not available.  

  19.     at sun.security.provider.SecureRandom.init(SecureRandom.java:99)  

  20.     at sun.security.provider.SecureRandom.<init>(SecureRandom.java:78)  

  21.     at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:192)  

  22.     at java.security.SecureRandom.<init>(SecureRandom.java:156)  

  23.     at java.io.File$TempDirectory.<clinit>(File.java:1901)  

  24.     at java.io.File.createTempFile(File.java:2010)  

  25.     at org.eclipse.equinox.launcher.Main.canWrite(Main.java:1312)  

  26.     at org.eclipse.equinox.launcher.Main.computeDefaultConfigurationLocation(Main.java:1294)  

  27.     at org.eclipse.equinox.launcher.Main.getConfigurationLocation(Main.java:1738)  

  28.     at org.eclipse.equinox.launcher.Main.processConfiguration(Main.java:1796)  

  29.     at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)  

  30.     at org.eclipse.equinox.launcher.Main.run(Main.java:1450)  

  31.     at org.eclipse.equinox.launcher.Main.main(Main.java:1426)  

  32. Caused by: java.security.NoSuchAlgorithmException: SHA MessageDigest not available  

  33.     at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)  

  34.     at java.security.Security.getImpl(Security.java:695)  

  35.     at java.security.MessageDigest.getInstance(MessageDigest.java:159)  

  36.     at sun.security.provider.SecureRandom.init(SecureRandom.java:97)  

  37.     ... 12 more  


提示,SHA-1这个算法无法找到,但这个是jdk系统提供的一个算法。包含在JAVA_HOME/jre/lib/jsse.jar中。


 

打开想要的目录查看,结果只有一个jsse.pack,而没有jsse.jar。 这也是异常抛出的原因了,使用unpack200进行对应jar包的解压。

[plain] view plain copy

  1. unpack200 jsse.pack jsse.jar  


如果提示:Error: Could not open jar file:jsse.jar

则表示当前用户对该目录的文件没有写的权限,使用root即可。 

[plain] view plain copy

  1. su root  


然后输入root的密码,在执行unpack命令即可。此时在命令行中使用root身份即可启动Eclipse。

但是,在Eclipse目录下,双击eclipse的图标,或者是不在root身份运行则提示错误:permission denied.


 

那么如何在图形界面上让eclipse使用root身份运行呢?


 

首先我们需要创建一个eclipse的快捷启动方式,比如这里我们创建到桌面:

[plain] view plain copy

  1. sudo gedit /home/gavin/Desktop/eclipse.desktop  


然后在打开的编辑器里输入:

[plain] view plain copy

  1. [Desktop Entry]  

  2. Categories=Development;  

  3. Comment[zh_CN]=  

  4. Comment=  

  5. Exec=/path/to/eclipse/eclipse  

  6. GenericName[zh_CN]=IDE  

  7. GenericName=IDE  

  8. Icon=/path/to/eclipse/icon.xpm  

  9. MimeType=  

  10. Name[zh_CN]=eclipse  

  11. Name=eclipse  

  12. Path=  

  13. StartupNotify=true  

  14. Terminal=false  

  15. Type=Application  


 

这样我们就创建了一个eclipse的快捷方式,注意启动的/path/to/eclipse换成你的eclipse路径即可。

但是这样还是无法启动,因为还是以普通方式启动的,接下来,我们需要使用gksu命令,

首先安装gksu:

[plain] view plain copy

  1. sudo apt-get install gksu  


然后再次编辑eclipse.desktop,将启动的Exec后面的命令加上gksu,

[plain] view plain copy

  1. Exec=gksu /path/to/eclipse/eclipse  


保存,然后双击快捷方式,则弹出root密码的输入,输入后方可启动eclipse。


 

如果出现Untrusted application launcher, 可使用chmod +x /path/to/eclipse.desktop即可

转载于:https://my.oschina.net/iioschina/blog/785586

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值