Debian Oracle Java8安装

2018-08-17  本文已影响37人  DeanWang
apt-get remove openjdk*
apt-key adv --recv-key --keyserver keyserver.ubuntu.com EEA14886
vi /etc/apt/sources.list
    "
      deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main 
      deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
    "
apt-get update
apt-get install oracle-java8-installer
// 执行完毕,查看版本
java -version
javac -version
apt-get install oracle-java8-set-default
这个命令运行后,在/etc/profile.d目录下生成:jdk.sh和jdk.csh。里面有5个export命令,用来设置Java环境变量
    "
      export J2SDKDIR=/usr/lib/jvm/java-8-oracle
      export J2REDIR=/usr/lib/jvm/java-8-oracle/jre
      export PATH=$PATH:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-      oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
      export JAVA_HOME=/usr/lib/jvm/java-8-oracle
      export DERBY_HOME=/usr/lib/jvm/java-8-oracle/db
    "
source /etc/profile
echo $JAVA_HOME
或者将内容复制进 ~/.bashrc
上一篇下一篇

猜你喜欢

热点阅读