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

相關文章
相關標籤/搜索