你好,游客 登录 注册 搜索
背景:
阅读新闻

Ubuntu 安装Oracle Java 7 (JDK)

[日期:2011-09-16] 来源:bentutu.com  作者:tuhaihe [字体:大 中 小]

Install Oracle Java 7 Browser plugin



Update: in my test, the Oracle Java 7 browser plugin crashes Firefox and doesn't load in Chrome and it seems I'm not the only one, so it would be a good idea noy to upgrade the browser plugin too (JDK 7 seems works ok). If you want to try it out anyway, see the installation instructions below. There are also instructions on reverting the changes at the end of the post.

Even though the steps below are for Firefox, the plugin will also be updated in Chrome (possibly other browsers too) as it looks under ~/.mozilla/plugins folder for plugins too.

Firstly, remove old Java plugin links using the commands below:
rm -f ~/.mozilla/plugins/libnpjp2.so ~/.mozilla/plugins/libjavaplugin_oji.so
sudo rm -f /usr/lib/firefox/plugins/libnpjp2.so /usr/lib/firefox/plugins/libjavaplugin_oji.so


And for the last step, let's create a simbolic link for the newly installed Java into the Mozilla plugins directory:

- 32bit:
ln -s /usr/lib/jvm/jdk1.7.0/lib/i386/libnpjp2.so ~/.mozilla/plugins/

- 64bit:
ln -s /usr/lib/jvm/jdk1.7.0/lib/amd64/libnpjp2.so ~/.mozilla/plugins/




Reverting the changes


Install Oracle JDK 6 from the Ubuntu repositories (make sure you enable the Partner repository under Ubuntu Software Center > Software Sources; alternatively, you can also use the LFFL Java PPA):
sudo apt-get install sun-java6-jdk sun-java6-plugin

Or, you can instal OpenDJK:
sudo apt-get install openjdk-6-jdk icedtea-plugin


Now run our script:
sudo update-java

And select the "java-6-sun-1.6.0.26" ("java-6-sun" works too) for Oracle JDK or the "java-1.6.0-openjdk" folder for OpenJDK.


For Oracle JDK, let's revert the browser plugin changes too:
rm -f ~/.mozilla/plugins/libnpjp2.so

32bit:
sudo ln -s /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/

64bit:
sudo ln -s /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
linux
相关资讯       ubuntu安装 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款