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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 冒泡排序算法(Java)

    冒泡排序算法(Java)

    2022年1月15日
  • 软件被拦截了不能使用如何解决_libwebsockets使用

    软件被拦截了不能使用如何解决_libwebsockets使用废话不多说直接上代码:不清楚的加群:群:191065815privatevoidForm1_Load(objectsender,EventArgse){try{//更改设置浏览器语言CefSettingssettings=new…

    2022年9月19日
  • ArcGIS路径分析_arcgis区域统计分析

    ArcGIS路径分析_arcgis区域统计分析在累积选项卡中,可以选择网络数据集中要对路径对象进行累积的成本属性。这些累积属性仅供参考;求解程序仅使用分析图层的阻抗参数所指定的成本属性来计算路径。

    2022年8月24日
  • lede旁路由设置方法

    lede旁路由设置方法lede固件号:2.361.把网络–>接口里面wan口删除2.推荐新建lan口,把原来的lan停用3.新lan口配置:静态地址ipv4地址:主路由地址ipv4子网掩码:255.255.255.0ipv4网关:主路由地址使用自定义的DNS服务器:主路由地址关闭DHCP如果出现访问国内网站巨慢,慢到离谱那种请在旁路由执行以下代码iptables-tnat-IPOSTROUTING-jMASQUERADE并在网络—>防火墙中勾选丢弃无用数据包…

    2022年6月11日
  • es面试题及答案_elk面试题

    es面试题及答案_elk面试题文章目录1、Elasticsearch了解多少,说说你们公司ES的集群架构,索引数据大小,分片有多少,以及一些调优手段。2、Elasticsearch的倒排索引是什么?3、Elasticsearch索引数据多了怎么办,如何调优,部署?4、Elasticsearch是如何实现master选举的?5、详细描述一下Elasticsearch索引文档的过程。6、详细描述一下Elasticsearch搜索的过程?7、Elasticsearch在部署时,对Linux的设置有哪些优化方法?8、lucence内部结构是什

    2022年9月13日
  • 莫尔斯电码参照表「建议收藏」

    莫尔斯电码参照表「建议收藏」1*2**3***–4****-5*****6-****7–***8**9*0A*-B-***C-*-*D-**E*F**-*G–

    2022年8月4日

发表回复

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

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