博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
change openjdk to Sun java
阅读量:5901 次
发布时间:2019-06-19

本文共 4570 字,大约阅读时间需要 15 分钟。

hot3.png

How to install the Java Runtime Environment from Java.com

If a browser plugin and Java runtime are all that is required, as opposed to a full Java development environment, the Oracle (formerly Sun) Java Runtime Environment (JRE) RPMs work for all currently supported CentOS versions, and are arguably the most compatible with web pages that require a Java plugin. The Java versions shown below are current as of this writing. Always use the latest available version for your architecture (i386 32-bit or x86_64/amd64 64-bit) and adjust accordingly.

is now available. It was reported as functional using the same procedure as below.

Java i386 JRE and plugin

Download the latest Linux RPM (self-extracting file), currently jre-6u30-linux-i586-rpm.bin, from then as install and configure the alternatives system and plugins:

# cd [download directory]# sh ./jre-6u30-linux-i586-rpm.bin# alternatives --config javaThere are 2 programs which provide 'java'.  Selection    Command-----------------------------------------------*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/javaEnter to keep the current selection[+], or type selection number:

Note number of versions, N, and use N+1 (if there is no output from the previous command, just imagine that N=0) - For example, if 2 versions were installed then:

# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 3# alternatives --config javaThere are 3 programs which provide 'java'.  Selection    Command-----------------------------------------------*+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java   3           /usr/java/latest/bin/javaEnter to keep the current selection[+], or type selection number: 3# java -versionjava version "1.6.0_30"Java(TM) SE Runtime Environment (build 1.6.0_30)Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

Create links in the Mozilla Plugins directory so Java will work in supported browsers such as Firefox.

# cd /usr/lib/mozilla/plugins/# ln -fs /usr/java/latest/lib/i386/libnpjp2.so

Skip to the section on testing the browser plugin.

Java x86_64 JRE and plugin

Download the latest Linux RPM (self-extracting file), currently jre-6u30-linux-x64-rpm.bin, from then as install and configure the alternatives system and plugins:

# cd [download directory]# sh ./jre-6u30-linux-x64-rpm.bin# alternatives --config javaThere are 4 programs which provide 'java'.  Selection    Command-----------------------------------------------   1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java   2           /usr/java/jre1.6.0_13/bin/java   3           /usr/java/jre1.6.0_18/bin/java*+ 4           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/javaEnter to keep the current selection[+], or type selection number:

Note number of versions, N, and use N+1 (if there is no output from the previous command, just imagine that N=0) - For example, if 4 versions were installed then:

# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 5# alternatives --config javaThere are 5 programs which provide 'java'.  Selection    Command-----------------------------------------------   1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java   2           /usr/java/jre1.6.0_13/bin/java   3           /usr/java/jre1.6.0_18/bin/java*+ 4           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java   5           /usr/java/latest/bin/javaEnter to keep the current selection[+], or type selection number: 5# java -versionjava version "1.6.0_26"Java(TM) SE Runtime Environment (build 1.6.0_30)Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

Create links in the Mozilla Plugins directory so Java will work in supported browsers such as Firefox.

# cd /usr/lib64/mozilla/plugins/# ln -fs /usr/java/latest/lib/amd64/libnpjp2.so

Test browser

Exit Firefox if it is running and [re]start Firefox. Type "about:plugins" in the URL field. It should show Java enabled.

at Java.com, at Java.com or at .

Remove old versions

Oracle recommends removing old Java versions as they represent a security risk if left installed. By default, the installation procedure above will not remove old versions so we must do this manually:

# rpm -qa jre\*jre-1.6.0_13-fcs.x86_64jre-1.6.0_18-fcs.x86_64jre-1.6.0_30-fcs.x86_64# rpm -e jre-1.6.0_18-fcs.x86_64 jre-1.6.0_13-fcs.x86_64

  • Java is a trademark of the Oracle Corporation.

  • This page created and maintained by . Other Wiki contributors are invited to make corrections, additions, or modifications.

转载于:https://my.oschina.net/dddttttt/blog/80882

你可能感兴趣的文章
javaScript设计模式——策略模式
查看>>
java提供类与cglib包实现动态代理
查看>>
flask上传多个文件,获取input中的数组
查看>>
更改UIView的背景
查看>>
webstorm快捷键
查看>>
工厂方法模式
查看>>
sun.misc.BASE64Encoder找不到jar包
查看>>
java.io.FileNotFoundException:文件名、目录名或卷标语法不正确
查看>>
配置IIS服务器支持Sencha Touch
查看>>
Oracle冷备份
查看>>
kindEditor或中的图片粘贴处理
查看>>
yii2 - Behavior 实例及源码分析
查看>>
如何去掉“来自Internet的文件......"提示框
查看>>
几种软件滤波算法 总结 转载
查看>>
django-groundwork
查看>>
maven 自定义插件开发
查看>>
Django 学习笔记---环境配置
查看>>
制作纸玫瑰[教程]
查看>>
InstallShield 2011新功能试用(1)- Standalone Build Mo...
查看>>
linux 安装nodejs
查看>>