Java安装6小部(适合新手)
1、下载软件包
# wget http://download.Oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz?AuthParam=1441937568_6752e90a2aa70be3cf8baa0b8905125c
更改软件名,不知为什么wget下载下来名称挺乱的
# mv jdk-7u79-linux-x64.tar.gz?AuthParam=1441937568_6752e90a2aa70be3cf8baa0b8905125c /root/jdk-7u79-linux-x64.tar.gz
# cd
2、解压jdk文件
# tar zxf jdk-7u79-linux-x64.gz -C /data/
3、创建软连接
# ln -s /data/jdk1.7.0_79 /usr/local/java
4、编辑环境变量(输入:$定位到文件最后一行,再执行o在文件的最后边编辑)
# vim /etc/profile
1 #------------------------------JAVA------------------------------#
2 export JAVA_HOME=/usr/local/java
3 export PATH=$JAVA_HOME/bin:$PATH
4 export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
5、使java的环境变量生效
# source /etc/profile
6、验证java是否安装成功(这条命令会返回java的版本信息)
# java -version
1 java version "1.7.0_79"
2 Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
3 Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
Ubuntu 14.04安装JDK1.8.0_25与配置环境变量 http://www.linuxidc.com/Linux/2015-01/112030.htm
CentOS 搭建JDK环境 http://www.linuxidc.com/Linux/2015-06/118879.htm
Ubuntu 14.04安装JDK1.8.0_25与配置环境变量 http://www.linuxidc.com/Linux/2015-01/112030.htm
Ubuntu 14.04 LTS安装Oracle JDK 1.8 http://www.linuxidc.com/Linux/2014-11/109216.htm
CentOS6.3安装JDK和环境配置 http://www.linuxidc.com/Linux/2012-09/70780.htm
Ubuntu 14.04 安装 JDK8 http://www.linuxidc.com/Linux/2014-09/106218.htm
Ubuntu下安装JDK图文解析 http://www.linuxidc.com/Linux/2014-09/107291.htm
本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-10/124113.htm