JDK 1.7安装详解(CentOS 6.4)
CentOS 6.4下安装JDK(Java Development Kit)
1)下载JDK 1.7(1.7.0_25)
下载地址为:
http://www.Oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
选中“Accept License Agreement”
选则64位的rpm包下载:jdk-7u25-linux-x64.rpm
2)安装JDK 1.7
Ø在usr下建立java文件夹,终端命令:(切换到root:su root)
Ø安装
等待安装即可
3)环境变量配置
Ø配置JAVA_HOME
# exportJAVA_HOME=<jdk-install-dir>
此处<jdk-install-dir>为jdk安装路径(直接拖动文件夹位置),如:/usr/java/jdk1.7.0_25
Ø配置PATH
# export PATH=$JAVA_HOME/bin:$PATH4)核实已为根用户设置好环境变量JAVA_HOME
# sudo env | grep JAVA_HOME5)添加到文件/etc/sudoers
Ø打开文件:
Ø进入编辑状态:
按键盘“i”键
Ø添加下面一行:
Defaults env_keep+=JAVA_HOMEØ退出编辑状态:
按键盘“Esc”键
Ø保存并退出文件
按键盘“Shift”+“:”键,输入:wq ;或者强制退出:wq!;不保存退出文件:q
相关阅读:
相关推荐
missingmuch 2020-07-19
lonesomer 2020-09-17
Locksk 2020-10-12
佛系程序员J 2020-10-10
gdb 2020-09-14
zousongshan 2020-08-10
hell0kitty 2020-07-28
malonely 2020-07-20
eternityzzy 2020-07-19
wangrui0 2020-06-28
一世为白 2020-06-21
MAC2007 2020-06-16
凉白开 2020-06-17
zhangwentaohh 2020-06-14
liangston 2020-06-14
linzb 2020-06-14
89421478 2020-06-12