Debian 7.x 安裝Oracle JAVA

下載java8html

下載地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.htmljava

卸載原先的openjdklinux

#apt-get autoremove openjdk*bash

上傳jdk-8u111-linux-x64.tar.gz到服務器並解壓服務器

解壓後: jdk1.8.0_111oracle

 

創建jvm目錄jvm

#mkdir /usr/lib/jvm測試

#cp -ar /root/jdk1.8.0_111 ./htm

#mv jdk1.8.0_111 jdk8rem

 

配置環境

#vi /root/.bashrc

export JAVA_HOME=/usr/lib/jvm/jdk8

export JRE_HOME=${JAVA_HOME}/jre

export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

export PATH=${JAVA_HOME}/bin:$PATH

 

#source ~/.bashrc

 

配置默認JDK

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk8/bin/java 300

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk8/bin/java 300

 

測試

#java -version

相關文章
相關標籤/搜索