如何升级Linux系统中的Java版本

  • A+
所属分类:资源分享

通过java -version命令查看下当前版本,当前版本为1.7.0_79,是系统自带的。

如何升级Linux系统中的Java版本

接下来使用rpm -qa | grep java,查看系统已经安装的java都有哪些。

如何升级Linux系统中的Java版本

用rpm -e命令删除所有版本的java,并使用java -version测试卸载是否成功。

如何升级Linux系统中的Java版本

下载1.8.0版的java,这里分别提供111_32位、144_64位两个版本:

此处为隐藏的内容!
登录后方可查看!

用tar -zxf命令解压到指定目录中,如目录不存在,可以用mkdir提前创建。

如何升级Linux系统中的Java版本

使用vi命令编辑/etc/profile文件,在末尾处加入以下内容:

  1. JAVA_HOME=/usr/java/jdk1.8.0_111
  2. JRE_HOME=/usr/java/jdk1.8.0_111/jre
  3. CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
  4. PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
  5. export JAVA_HOME JRE_HOME CLASS_PATH PATH

然后使用source /etc/profile使配置文件生效,最后使用java -version测试下。

如何升级Linux系统中的Java版本

  • 问答中心
  • 微信小程序扫一扫
  • weinxin
  • 微信公众
  • 微信公众号扫一扫
  • weinxin

发表评论

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

目前评论:26   其中:访客  26   博主  0

    • avatar Herren fitness T-Shirts kaufen

      I have recently started a site, the info you offer on this web site has helped me greatly. Thanks for all of your time & work.

      • avatar grolyrtolemcs

        Nice post. I was checking continuously this blog and I’m impressed! Very useful information particularly the last part :) I care for such info a lot. I was looking for this certain information for a long time. Thank you and good luck.

        • avatar Robert Bergman

          As I site possessor I believe the content material here is rattling wonderful , appreciate it for your efforts. You should keep it up forever! Best of luck.

          • avatar weekend car rental

            Cool blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple tweeks would really make my blog stand out. Please let me know where you got your theme. Bless you

            • avatar cbd oil that works 2020

              When I initially commented I appear to have clicked on the
              -Notify me when new comments are added- checkbox and now every
              time a comment is added I receive four emails with the exact same comment.
              Perhaps there is an easy method you can remove me from that service?
              Kudos!

              • avatar tinyurl.com

                What’s up to all, as I am truly eager of reading this weblog’s post
                to be updated on a regular basis. It carries pleasant material.