jdk安装和设置

1、上传安装包

  • 建立四个目录:/www/soft,/www/platform,/www/data,/www/web
  • 将jdk上传到soft中

2、解压

  • 将上传的jdk复制到platform中,并解压
[root@iZ2ze6vptwtuhih999ijvkZ platform]# tar -zxvf jdk-8u161-linux-x64.tar.gz
  • 设置环境变量
[root@iZ2ze6vptwtuhih999ijvkZ platform]# vi /etc/profile
export JAVA_HOME=/www/platform/jdk1.8.0_161
export JRE_HOME=/www/platform/jdk1.8.0_161/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$JMETER/lib/ext/ApacheJMeter_core.jar:$JMETER/lib/jorphan.jar:$JMETER/lib/logkit-2.0.jar:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$MAVEN_HOME/bin:$JMETER/bin:$PATH
  • 使修改生效
[root@iZ2ze6vptwtuhih999ijvkZ platform]# source /etc/profile
  • 验证
[root@iZ2ze6vptwtuhih999ijvkZ platform]# java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
[root@iZ2ze6vptwtuhih999ijvkZ platform]# 

 

你可能感兴趣的:(基础软件安装)