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

3 篇文章 0 订阅

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


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

An exception occurred while writing to the platform log:
java.lang.NullPointerException
	at org.eclipse.equinox.launcher.Main.openLogFile(Main.java:2559)
	at org.eclipse.equinox.launcher.Main.log(Main.java:2392)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Logging to the console instead.
!ENTRY org.eclipse.equinox.launcher 4 0 2014-06-01 00:30:05.824
!MESSAGE Exception launching the Eclipse Platform:
An exception occurred while writing to the platform log:
java.lang.NullPointerException
	at org.eclipse.equinox.launcher.Main.openLogFile(Main.java:2559)
	at org.eclipse.equinox.launcher.Main.log(Main.java:2392)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Logging to the console instead.
!STACK
java.lang.InternalError: internal error: SHA-1 not available.
	at sun.security.provider.SecureRandom.init(SecureRandom.java:99)
	at sun.security.provider.SecureRandom.<init>(SecureRandom.java:78)
	at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:192)
	at java.security.SecureRandom.<init>(SecureRandom.java:156)
	at java.io.File$TempDirectory.<clinit>(File.java:1901)
	at java.io.File.createTempFile(File.java:2010)
	at org.eclipse.equinox.launcher.Main.canWrite(Main.java:1312)
	at org.eclipse.equinox.launcher.Main.computeDefaultConfigurationLocation(Main.java:1294)
	at org.eclipse.equinox.launcher.Main.getConfigurationLocation(Main.java:1738)
	at org.eclipse.equinox.launcher.Main.processConfiguration(Main.java:1796)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:563)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.security.NoSuchAlgorithmException: SHA MessageDigest not available
	at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)
	at java.security.Security.getImpl(Security.java:695)
	at java.security.MessageDigest.getInstance(MessageDigest.java:159)
	at sun.security.provider.SecureRandom.init(SecureRandom.java:97)
	... 12 more

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


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

unpack200 jsse.pack jsse.jar

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

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

su root

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

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



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


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

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

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

[Desktop Entry]
Categories=Development;
Comment[zh_CN]=
Comment=
Exec=/path/to/eclipse/eclipse
GenericName[zh_CN]=IDE
GenericName=IDE
Icon=/path/to/eclipse/icon.xpm
MimeType=
Name[zh_CN]=eclipse
Name=eclipse
Path=
StartupNotify=true
Terminal=false
Type=Application


 

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

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

首先安装gksu:

sudo apt-get install gksu

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

Exec=gksu /path/to/eclipse/eclipse

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


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


  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值