Centos7下安装与卸载Jdk1.8

Centos7下安装与卸载Jdk1.8卸载查看已经安装的jdk[root@bogonjre]#rpm-qa|grepjdkjava-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64java-1.7.0-openjdk-1.7.0.91-2.6.2.3.el7.x86_64java-1.7.0-openjdk-headless-1.7.0.91-2.6.2.3.el7.x86_

大家好,又见面了,我是你们的朋友全栈君。

卸载

查看已经安装的jdk

[root@bogon jre]# rpm -qa|grep jdk
java-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64
java-1.7.0-openjdk-1.7.0.91-2.6.2.3.el7.x86_64
java-1.7.0-openjdk-headless-1.7.0.91-2.6.2.3.el7.x86_64
java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64

卸载命令

[root@bogon jre]# yum -y remove java-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64

卸载完成之后Java命令不被识别

[root@bogon lib]# java -version
bash: java: command not found...

安装

去官网下载jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
解压到安装目录

[root@bogon software]# tar -zxvf jdk-8u101-linux-x64.tar.gz -C /usr/local/java/

安装完毕之后在/etc/profile文件末尾添加

[root@bogon software]# vim /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_101
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

使/etc/profile生效

[root@bogon jdk1.8.0_101]# source /etc/profile

检测安装是否成功

[root@bogon jdk1.8.0_101]# java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
[root@bogon jdk1.8.0_101]# javac
Usage: javac <options> <source files>
where possible options include:
  -g Generate all debugging info   -g:none Generate no debugging info   -g:{lines,vars,source} Generate only some debugging info   -nowarn Generate no warnings   -verbose Output messages about what the compiler is doing   -deprecation Output source locations where deprecated APIs are used   -classpath <path> Specify where to find user class files and annotation processors   -cp <path> Specify where to find user class files and annotation processors   -sourcepath <path> Specify where to find input source files   -bootclasspath <path> Override location of bootstrap class files   -extdirs <dirs> Override location of installed extensions   -endorseddirs <dirs> Override location of endorsed standards path   -proc:{none,only} Control whether annotation processing and/or compilation is done.   -processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process   -processorpath <path> Specify where to find annotation processors   -parameters Generate metadata for reflection on method parameters   -d <directory> Specify where to place generated class files   -s <directory> Specify where to place generated source files   -h <directory> Specify where to place generated native header files   -implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files   -encoding <encoding> Specify character encoding used by source files   -source <release> Provide source compatibility with specified release   -target <release> Generate class files for specific VM version   -profile <profile> Check that API used is available in the specified profile   -version Version information   -help Print a synopsis of standard options   -Akey[=value] Options to pass to annotation processors   -X Print a synopsis of nonstandard options   -J<flag> Pass <flag> directly to the runtime system   -Werror Terminate compilation if warnings occur   @<filename>                Read options and filenames from file
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/152994.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • SMTP服务器地址_接收邮件服务器和发送邮件服务器

    SMTP服务器地址_接收邮件服务器和发送邮件服务器网站smtp服务器内容精选换一换如果您需要使用创建的云服务器搭建一个对外展示的网站或者Web应用程序,请按以下步骤进行相关的配置操作。建站参考如果您使用的是公共镜像创建的云服务器,那么购买完成后可以参考以下建站指导完成完网站或应用程序的搭建。搭建WordPress博客平台,请参考部署WordPress博客系统搭建Discuz论坛平台,请参考搭建Discuz论坛网站。更云解析服务支持为域名快速添…

    2022年10月3日
    2
  • gis地理加权回归步骤_地理加权回归权重

    gis地理加权回归步骤_地理加权回归权重内容导读1)回归概念介绍;2)探索性回归工具(解释变量的选择)使用;3)广义线性回归工具(GLR)使用;*加更:广义线性回归工具的补充内容4)地理加权回归工具(GWR)使用+小结。说明:本节是这个学习笔记最后一部分。PART/04地理加权回归工具(GWR)使用上一节我们讲了GLR广义线性回归,它是一种全局模型,可以构造出最佳描述研究区域中整体数据关系的方程。如果这些关系在研究区域中是一致的,则GLR回归方程可以对这些关系进行很好的建模。不过,当这些关系在研

    2022年10月6日
    3
  • 舆情大数据系统_大数据舆情分析工具有哪些

    舆情大数据系统_大数据舆情分析工具有哪些摘要: 前言在时下互联网信息的浪潮下,信息的传播速度远超我们的想象。微博里一条大V的帖子,朋友圈的一个状态更新,热门论坛的一条新闻,购物平台的购物评价,可能会产生数以万计的转发,关注,点赞。如果是一些非理性负面的评论会激发人们的负面感,甚至影响到消费者对企业品牌的认同,如果不能及时的采取正确的应对措施,会造成难以估计的损失。前言在时下互联网信息的浪潮下,信息的传播速度远超我们的想象。微…

    2025年11月11日
    3
  • MVC3和MVC4中CRUD操作

    MVC3和MVC4中CRUD操作

    2022年1月23日
    48
  • oracle db于,一个特定的数据字典pct miss其计算公式

    oracle db于,一个特定的数据字典pct miss其计算公式

    2022年1月13日
    295
  • idea2021 激活码 csdn【永久激活】

    (idea2021 激活码 csdn)2021最新分享一个能用的的激活码出来,希望能帮到需要激活的朋友。目前这个是能用的,但是用的人多了之后也会失效,会不定时更新的,大家持续关注此网站~https://javaforall.net/100143.htmlIntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,上面是详细链接哦~ML…

    2022年3月20日
    667

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号