Linux JAVA安装

  • A+
所属分类:Java

 

JAVA官网下载地址:http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk8-downloads-2133151-zhs.html

 

1. 下载安装jdk

  1. wget https://www.linuxgogo.com/repodata/java/jdk-8u172-linux-x64.tar.gz 
  2. tar xf /jdk-8u172-linux-x64.tar.gz  
  3. mv jdk1.8.0_172 /usr/local/java    #当然路径和名字自定义即可,注意环境变量不要配置错就可以  

  

2. 设置环境变量:

  1. export JAVA_HOME=/usr/local/java  
  2. export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH  
  3. export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar  

  

  

zhaoyulin

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: