【√】安装jdk-linux
1,下载JDK
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
查看当前Linux系统是否已经安装java
rpm -qa | grep -i java
2,使用XFTP工具导入linux
3,解压到/usr/local/java目录
创建usr/local/java Mkdir /usr/local/java 解压 tar -zxvf 压缩包 -C usr/local/java 配置环境变量之前可以测试 /你的解压目录/bin/java -version 或 到bin目录下 ./java -version |
4,配置环境 变量
vi /etc/profile 1. JAVA_HOME=/usr/local/java/jdk1.8.0_181 PATH=$JAVA_HOME/bin:$PATH CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JAVA_HOME export PATH export CLASSPATH
2. JAVA_HOME=/java/jdk1.8.0_161 |
5,刷新环境变量
source /etc/profile
6,测试环境变量
java -version