Red Hat Enterprise Linux 5 安装JDK6
Red Hat Enterprise Linux 5 安装JDK
1、 在官网下载,我下载的是jdk-6u30-linux-i586-rpm.bin文件。放在/home目录下。
2、 先删除系统原先jdk1.4,系统自带jdk。用java –version查看系统自带jdk版本。
[root@localhost /]# rpm -qa | grep gcj
java-1.4.2-gcj-compat-1.4.2.0-40jpp.112
卸载命令
[root@localhost /]# rpm -e --nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.112
3、 赋执行权限
[root@localhost home]# chmod +x jdk-6u30-linux-i586-rpm.bin
4、 执行安装
[root@localhost home]# ./jdk-6u30-linux-i586-rpm.bin
出现以下安装界面
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
inflating: jdk-6u30-linux-i586.rpm
inflating: sun-javadb-common-10.6.2-1.1.i386.rpm
inflating: sun-javadb-core-10.6.2-1.1.i386.rpm
inflating: sun-javadb-client-10.6.2-1.1.i386.rpm
inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm
inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm
inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...
Installing JavaDB
Preparing... ########################################### [100%]
1:sun-javadb-common ########################################### [ 17%]
2:sun-javadb-core ########################################### [ 33%]
3:sun-javadb-client ########################################### [ 50%]
4:sun-javadb-demo ########################################### [ 67%]
5:sun-javadb-docs ########################################### [ 83%]
6:sun-javadb-javadoc ########################################### [100%]
Java(TM) SE Development Kit 6 successfully installed.
Product Registration is FREE and includes many benefits:
* Notification of new versions, patches, and updates
* Special offers on Oracle products, services and training
* Access to early releases and documentation
Product and system data will be collected. If your configuration
supports a browser, the JDK Product Registration form will
be presented. If you do not register, none of this information
will be saved. You may also register your JDK later by
opening the register.html file (located in the JDK installation
directory) in a browser.
For more information on what data Registration collects and
how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html
Press Enter to continue.....
Done.
安装成功,默认安装在/usr/java目录下。
5、 配置环境变量
[root@localhost home]# vi /etc/profile
打开文件后按i键,在文件最后插入以下配置
#JAVA
export JAVA_HOME=/usr/java/jdk1.6.0_30
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$CLASSPATH
按esc 键
输入:wq 保存退出。
再使配置生效 source /etc/profile
6、 查看java版本
[root@localhost /]# java –version
java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing)
到此为止安装完毕。
推荐阅读
-
Red Hat Enterprise Linux / CentOS 7 yum安装zabbix4.0
-
Win7下硬盘安装 Red Hat Enterprise Linux 6.0 ES图文方法
-
Red Hat Linux,Apache2.0+Weblogic9.2负载均衡集群安装配置
-
windows系统安装虚拟机VMware12,然后在虚拟机中安装Red Hat Enterprise Linux6操作系统
-
red hat linux之Samba、DHCP、DNS、FTP、Web的安装与配置
-
Red Hat Enterprise Linux 8.0 安装
-
Linux:Red Hat系统的安装
-
Red Hat Enterprise Linux 官方正式版镜像下载
-
Red Hat enterprise 5 gcc安装顺序
-
VMware15 虚拟机安装 Red Hat Enterprise Linux (RHEL) 7.0 Server