下載 jdkhtml
安裝解壓:java
sudo tar zxvf ./jdk-8u101-linux-x64.tar.gz -C /usr/lib/jvm cd /usr/lib/jvm sudo mv jdk-8u101-linux-x64 jdk1.8
修改環境變量:linux
gedit ~/.bashrc
末尾添加:bash
export JAVA_HOME=/usr/lib/jvm/jdk1.8 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
保存後退出,輸入一下命令生效:oracle
source ~./bashrc
測試jvm
rancvl@rancvl:~$ java -version java version "1.8.0_101" Java(TM) SE Runtime Environment (build 1.8.0_101-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)