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


相关推荐

  • seekg ()[通俗易懂]

    seekg ()[通俗易懂] seekg语法:istream&seekg(off_typeoffset,ios::seekdirorigin);istream&seekg(pos_typeposition);函数seekg()用于输入流,并且它将重新设置”get”指针到当前流的从origin偏移offset个字节的位置上,或是置”get”指针在position位

    2022年6月10日
    40
  • 计算机中进制转换方法_电脑进制转换方法

    计算机中进制转换方法_电脑进制转换方法计算机进制转换方法从小我们就开始学数学数学就有涉及到进制知识相信大家对于进制都不陌生吧进制也就是进位制是一种进位方法现在大家都有电脑利用电脑自带的计算机进行进制转换是最简便的方法下面是由百分网小编为大家准备的计算机进制转换方法喜欢的可以收藏一下!了解更多详情资讯请关注应届毕业生考试网!计算机中常用的进制主要有:二进制、八进制、十六进制学习计算机要对其有所了解2进制用两个阿拉伯数字:0、1;8进制用…

    2025年8月1日
    5
  • 解决H5页面在微信浏览器中打开 input file 在安卓上没有拍照选项

    解决H5页面在微信浏览器中打开 input file 在安卓上没有拍照选项有时候我们会在微信公众号里开发会遇到上传图片的功能,当你写&lt;inputtype="file"&gt;的时候,在IOS上可以成功调起拍照和图库两块,在安卓手机上只能调取图库而没有拍照功能,解决办法:给input加上accept属性&lt;inputtype="file"accept="image/*"/&gt; //调用相机,图片或者相册(两者都行)加上了capture=…

    2022年7月17日
    27
  • 自动滑块验证码识别_滑块验证码原理

    自动滑块验证码识别_滑块验证码原理一、滑块验证码简述有爬虫,自然就有反爬虫,就像病毒和杀毒软件一样,有攻就有防,两者彼此推进发展。而目前最流行的反爬技术验证码,为了防止爬虫自动注册,批量生成垃圾账号,几乎所有网站的注册页面都会用到验证码技术。其实验证码的英文为CAPTCHA(CompletelyAutomatedPublicTuringtesttotellComputersandHumans…

    2025年8月6日
    3
  • security protected_license server detected什么意思

    security protected_license server detected什么意思http://3g.365jia.cn/js/riot.min.jshttp://a.adnium.com/static?r=23326206&id=94837&pid=5044&sid=73633&tid=1&w=300&h=250http://aaa.1688zl.top/static/bottom.jshttp://ca2.hnzz-zhuor…

    2025年11月24日
    3
  • 解决kali-linux更新源无法使用的问题(签名失效)

    解决kali-linux更新源无法使用的问题(签名失效)本来说是这个寒假好好学习一下渗透测试的,可随着了解的深入,发现渗透测试需要的知识储备太多了,因此好长时间都没有真正的去学习渗透工具的使用,今天上午装了一个kali,装上之后第一件事就是执行apt-getupdate&&apt-getupgrade,结果却出现了这样的错误我添加的是中科大的更新源,在浏览器中是可以正常打开的:debhttp://mirrors.ustc.ed

    2022年5月28日
    220

发表回复

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

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