centos安装jdk
https://www.cnblogs.com/taohaijun/p/7153176.html
https://blog.csdn.net/hui_2016/article/details/69941850
https://blog.csdn.net/fuyuwei2015/article/details/73195936
1. 查看已经安装的jdk
rpm -qa|grep jdk
rpm -qa|grep java
如果有,卸载:
rpm -e --nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64
2. 上传并安装
rpm -ivh jdk-8u162-linux-x64.rpm
3. 检查
java -version
4. 配置环境变量
在/etc/profile文件末尾添加:
export JAVA_HOME=/usr/java/jdk1.8.0_162
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
使/etc/profile生效:
source /etc/profile
相关推荐
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