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

 

 

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


 

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

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

[plain] view plain copyapp

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

  2. java.lang.NullPointerException  eclipse

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

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

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

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

  7. Logging to the console instead.  .net

  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便可

相关文章
相关标签/搜索