Need to install sun java jdk on ubuntu

sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse"

sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse"

sudo apt-get update

sudo apt-get install sun-java5-jdk

It took a while, some unrelated warnings were fired, but at the end it was installed. After the installation was finished I just did:

sudo update-alternatives --config java

and switched to java5

which was one of the alternatives.

Hope it helps.NelsonPS. You should be able to go back to java 6 after that just by issuing an uptade-alternatives call.


from:  http://serverfault.com/questions/293392/need-to-install-sun-java5-jdk-on-ubuntu-11-04


Ubuntu 10.04 LTS 安装sun-java6-jdk ,出现错误。
Reading package lists... Done
Building dependency tree  
Reading state information... Done
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate

说是Ubuntu 10.04已经去掉sun-java6-jdk 和sun-java6-jre的软件包

记得在国外某个论坛看到说,这个包已经从2012-2-26就移走了。

最后实现办法

1、添加这个源:

sudo add-apt-respository "deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse" 

2、sudo apt-get update
3、sudo apt-get install sun-java6-jdk  OK了

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

https://help.ubuntu.com/community/Java
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值