1. 程式人生 > >jdk安裝和設定

jdk安裝和設定

1、上傳安裝包

  • 建立四個目錄:/www/soft,/www/platform,/www/data,/www/web
  • 將jdk上傳到soft中

2、解壓

  • 將上傳的jdk複製到platform中,並解壓
[[email protected] platform]# tar -zxvf jdk-8u161-linux-x64.tar.gz
  • 設定環境變數
[[email protected] 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
  • 使修改生效
[[email protected] platform]# source /etc/profile
  • 驗證
[[email protected] 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)
[[email protected] platform]#