linux JDK 安装详解

1、检查一下系统中的jdk版本

[root@node50 ~]#java -version

#java -version

#java -version

openjdk version “1.8.0_131”
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)

2、检测jdk安装包

[root@node50 ~]

#rpm -qa | grep java

tzdata-java-2017b-1.el7.noarch
javapackages-tools-3.4.1-11.el7.noarch
java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64
java-1.8.0-openjdk-headless-1.8.0.131-11.b12.el7.x86_64
python-javapackages-3.4.1-11.el7.noarch

3、卸载openjdk

[root@node50 ~]#yum remove openjdk

4、安装新的jdk

首先到jdk官网上下载你想要的jdk版本

https://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

我这提供本次实验版本

链接: https://pan.baidu.com/s/1IwOGxfwsi5ww91w5ELZEBQ 提取码: rbr7

5.解压 jdk-8u131-linux-x64.tar.gz安装包

[root@node50 ~]# tar -xf jdk-8u191-linux-x64.tar.gz -C /usr/local/

查看

[root@node50 ~]

# ls /usr/local/jdk1.8.0_191/
bin jre README.html THIRDPARTYLICENSEREADME.txt
COPYRIGHT lib release
include LICENSE src.zip
javafx-src.zip man THIRDPARTYLICENSEREADME-JAVAFX.txt

maven安装

1、下载maven

wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz

2、解压至/usr/local目录

tar -xf apache-maven-3.2.5-bin.tar.gz -C /usr/local/

6.设置环境变量在末尾添加4行

[root@node50 ~]

# vim /etc/profile

export JAVA_HOME=/usr/local/jdk1.8.0_191
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

export MAVEN_HOME=/usr/local/apache-maven-3.2.5
export PATH=${PATH}:${MAVEN_HOME}/bin

6、执行profile文件

[root@node50 ~]

# source /etc/profile
这样可以使配置不用重启即可立即生效。

7、检查新安装的jdk

[root@node50 ~]

# java -version
java version “1.8.0_191”
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

8.验证mvn

[ ~]# mvn -v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-15T01:29:23+08:00)
Maven home: /usr/local/apache-maven-3.2.5
Java version: 1.8.0_191, vendor: Oracle Corporation
Java home: /usr/local/jdk1.8.0_191/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: “linux”, version: “3.10.0-957.el7.x86_64”, arch: “amd64”, family: “unix”

原文链接:,转发请注明来源!

发表评论

要发表评论,您必须先登录

  • 7 Responses to “linux JDK 安装详解”
    • purchasing viagra from canada lunqdr

      northwestpharmacy.com <a href="http://edpharmacystore.com/">additional reading</a> canadian pharcharmy online without prescription
      <a href=http://edpharmacystore.com/>try these guys out</a>

    • online pharmacies in canada vekrcv

      cialis from canadian pharmacies <a href="http://edpharmacystore.com/">more about the author</a> buy cialis online canada pharmacy
      <a href=http://edpharmacystore.com/>agree with</a>

    • female viagra ockcth

      drugs-med.com <a href=http://www.canada1drugstore.com/tadalafil/>medications in canada</a> canadian viagra online pharmacy
      <a href="http://www.canada1drugstore.com/tadalafil/">my canadian pharmacies</a> northwest canadian pharcharmy online

    • buy viagra usa osfcuy

      cheapest price for cialis <a href="https://lynnemctaggart.com/forum/members/vadvad2/activity/456871/">best place to buy viagra</a> buying viagra in canada <a href=https://vuf.minagricultura.gov.co/Lists/Informacin%20Servicios%20Web/DispForm.aspx?ID=12501>do you need a prescription for cialis</a> drug store online
      walmart drug prices without insurance <a href="https://timeoftheworld.date/wiki/Take_Control_Of_Your_Health_With_These_Great_Acid_Reflux_Tips">discount cialis canada</a> www.canadadrugsonline.com <a href=http://atozsrilanka.com/user/profile/175113>viagra facts</a> viagra effects on women
      buy cheap generic viagra <a href="http://pwsy.org/story.php?title=leading-tips-to-solve-any-hairy-situation#discuss">viagra samples</a> canada med <a href=http://zohil.net/index.php?qa=user&qa_1=duushorowitz8>prescription drugs from canada prices</a> order generic viagra
      viagra canada

    • Charlesedity

      viagra and alcohol <a href="https://www.bonanza.com/users/47626722/profile">buy cialis online canada</a> buy viagra from canada pharmacy <a href=https://godotengine.org/qa/index.php?qa=user&qa_1=chaney73timmermann>canadian drug stores</a> viagra online canadian pharmacy
      canada med <a href="https://www.carhubsales.com.au/user/profile/331503">buy cialis online</a> can women take viagra <a href=http://www.biagiodanielloflash.com/home/index.php?option=com_k2&view=itemlist&task=user&id=495478>drugstore in canada</a> generic viagra pills
      viagra online canada pharmacy <a href="http://wx2.jjcbw.com/home.php?mod=space&uid=333085">cialis canadian pharmacy</a> pfizer viagra <a href=http://forum.learninweb.com/member.php?action=profile&uid=27466>canadian drugs online</a> viagra tablets
      canada prescriptions

    • cialis for daily use qcggbg

      canadian pharmacy and cialis <a href=http://www.canada1drugstore.com/tadalafil/>buying viagra from canada</a> northwestpharmacy.com
      <a href="http://www.canada1drugstore.com/tadalafil/">canadian meds</a> canadian levitra

    • Stephenpeaky

      generic name for viagra <a href=" http://sild100fast.com/# ">viagra for sale</a> non prescription viagra