Fedora 12使用sun java

1.Download the Java package from:
http://java.sun.com/javase/downloads/index.jsp. Always use the latest update.
Select: Java SE Runtime Environment (JRE) 6 Update 17 (the JDK is for developers)
On the next page, for Platform select "Linux" for 32-bit users, and "Linux x64" for 64-bit users.
For Language select "Multi-language". Also accept the license agreement, and hit "Continue".
On the next page, select the RPM option:
Java SE Runtime Environment 6u17
jre-6u17-linux-i586-rpm.bin     (32-bit users)
jre-6u17-linux-x64-rpm.bin      (64-bit users)

2.To install:
[mirandam@charon Download]$ sudo sh jre-6u17-linux-i586-rpm.bin
-OR-
[mirandam@charon Download]$ sudo sh jre-6u17-linux-x64-rpm.bin
You will need to hit 'space' till it reaches the end, then type 'yes'. You should see the RPM installing. If it does not install, manually install it via sudo rpm -ivh.
When running the java command, Fedora will default to using OpenJDK. In order to use Sun Java, use the alternatives command.
To setup the Java runtime, perform the following (applies to both 32-bit and 64-bit users):
[mirandam@charon Download]$ sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/default/bin/java 20000

3.Setup the Mozilla/Firefox browser plugin.
For 32-bit users:
[mirandam@charon Download]$ sudo /usr/sbin/alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so /
libjavaplugin.so /usr/java/default/plugin/i386/ns7/libjavaplugin_oji.so 20000
For 64-bit users:
[mirandam@charon Download]$ sudo /usr/sbin/alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so /
libjavaplugin.so.x86_64 /usr/java/default/lib/amd64/libnpjp2.so 20000
You may need to restart Firefox to see the plugin take effect.

4.Note: If you wish to switch back to OpenJDK you can run the following commands one by one to switch between the OpenJDK and Sun Java:
[mirandam@charon ~]$ sudo /usr/sbin/alternatives --config java
[mirandam@charon ~]$ sudo /usr/sbin/alternatives --config libjavaplugin.so
(or for 64-bit)
[mirandam@charon ~]$ sudo /usr/sbin/alternatives --config libjavaplugin.so.x86_64
To Update: If you wish update the JRE package, simply download the newest RPM package and install it as above. You will NOT need to reset alternatives, as those settings should remain intact.

another method:
1.find IcedTeaPlugin.so in the directoyr /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/;
2.install sun jdk on /usr/local/java/jdk1.6.0_16/;
3.mv /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/IcedTeaPlugin.so /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/IcedTeaPlugin.so_bak
4.ln -s /usr/local/java/jdk1.6.0_16/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/IcedTeaPlugin.so
5.sudo firefox, and input about:plugins in address bar, you will find firefox now support sun jdk;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mounter625

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值