标签:
1.jdk 1.8
系统版本
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
#安装之前先查看一下有无系统自带jdk
rpm -qa |grep java
rpm -qa |grep jdk
rpm -qa |grep gcj
#如果有就使用批量卸载命令
rpm -qa | grep java | xargs rpm -e --nodeps
直接yum安装1.8.0版本openjdk
[root@localhost ~]# yum install java-1.8.0-openjdk* -y
查看版本
[root@localhost ~]# java -version
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
默认jre jdk 安装路径是/usr/lib/jvm 下面
#如何使所有用户生效的配置
vim /etc/profile
#set java environment
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-3.b13.el6_10.x86_64/jre
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
export PATH=$PATH:${JAVA_PATH}
#退出编辑并保存
:wq!
#使得配置生效
source /etc/profile
#查看变量
[root@localhost ~]# echo $JAVA_HOME
/usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64
[root@localhost ~]# echo $CLASSPATH
.:/usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/lib/dt.jar:/usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/lib/tools.jar
javac 和java 命令都有输出设置提示就表示安装和环境配置成功了
2.mysql 5.7
标签:
来源: https://www.cnblogs.com/jiathis/p/9637066.html