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


相关推荐

  • idea永久激活码[在线序列号]

    idea永久激活码[在线序列号],https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月20日
    130
  • 安卓CTS测试(测试手机性能的软件)

    CTS和GTS测试基本操作步骤    CTS全称CompatibilityTestSuite(兼容性测试),CTS的目的就是让各种Android设备(如手机)开发商能够开发出兼容性更好的Android设备,Google制定了CDD(CompatibilityDefinationDocument)规范,为了达到验证CDD规范的目的,提供了一组CASE给不同平台厂商进行验证,Andr…

    2022年4月10日
    73
  • Ubuntu 14.04 LTS系统中配置Apache2虚拟主机[通俗易懂]

    Ubuntu 14.04 LTS系统中配置Apache2虚拟主机[通俗易懂]在Ubuntu14.04LTS系统中设置Apache虚拟主机1.安装用下面命令来安装apache网络服务器:$sudoapt-getinstallapache22.检查是否安装成功安装apache服务器之后,让我们通过这个URLhttp://你的服务器的IP地址/来测试网站服务器是否正常工作如果出现“ItWorked!”的示例页,说明apache服务器已经开始工作了3.

    2022年9月18日
    0
  • golang json 转map

    golang json 转map//convertjsontomappackagemainimport(“fmt””encoding/json”)funcmain(){b:=[]byte(`{“IP”:”192.168.11.22″,”name”:”SKY”}`)m:=make(map[string]string)err:=json.Unmarsha

    2022年6月16日
    231
  • Python.win32gui.获取窗体「建议收藏」

    Python.win32gui.获取窗体「建议收藏」importwin32gui,win32conimportpyautoguiaspg#自己的库fromastd.lib.astd_funcimportfind_pic#窗体标题,用spy++获取wdname=’傲视天地-1-5合区-360游戏中心-MozillaFirefox’#None表示从最顶层桌面找起,如果未找到返回0#从顶层窗口向下搜索主窗…

    2025年7月4日
    0
  • mysql databus_Databus架构分析与初步实践(for mysql)(上篇)

    mysql databus_Databus架构分析与初步实践(for mysql)(上篇)作者:徐和东description:目前关于databus的相关资料较少,特别是针对mysql的文档尤为稀少。本篇文章中介绍了databus相关组件及实现原理,初步实现了databus对mysql数据库的数据抓取,希望对后续使用者能提供一定的参考作用。categories:后端date:2017/5/24tags:DatabusForMysql低延迟数据抓取数据库日志挖掘1.简介…

    2022年10月16日
    0

发表回复

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

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