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


相关推荐

  • 常用正则说明

    常用正则说明

    2021年10月31日
    38
  • sklearn linear regression_auto sklearn

    sklearn linear regression_auto sklearnK折交叉验证:sklearn.model_selection.KFold(n_splits=3,shuffle=False,random_state=None)思路:将训练/测试数据集划分n_splits个互斥子集,每次用其中一个子集当作验证集,剩下的n_splits-1个作为训练集,进行n_splits训练和测试,得到n_splits个结果注意点:对于不能均等份的数据集,其前n_sa

    2022年9月20日
    0
  • 关于COM对象创建(CoCreateInstance,与QueryInterface)

    关于COM对象创建(CoCreateInstance,与QueryInterface)panda2002-12-1905:40PM一个土问题,关于COM对象的创建 因为生活所迫,这几天必须对COM有所了解。今天看了之后,对COM对象的创建有所困惑。使用CoCreateInstance和QueryInterface两种方法创建COM对象有何不同?例子程序如下:代码://CreateaCOMobjectfromtheShellLinkcoclasshr=CoCr

    2022年7月22日
    7
  • Zookeeper安装_windows docker安装部署

    Zookeeper安装_windows docker安装部署百度网盘链接提取码:yg12拷贝zoo.cfg更改日志输出路径新建文件夹启动成功

    2022年8月8日
    1
  • 在Windows Server 2012 中安装 .NET 3.5 Framework「建议收藏」

    在Windows Server 2012 中安装 .NET 3.5 Framework「建议收藏」现在仍然有许多程序和应用需要依靠.NET3.5framework来运行。比如sqlserver在WindowsServer2012中,微软提供了.NET3.5和.NET4.5的安装选项以为你的应用程序提供支持。但在安装.NET3.5组件时提示如下信息!当使用服务器管理器来安装.NET3.5时你可能会遇到下面的提示信息,指出源文件无法找到安装其他的功能在添加时并不需要我们提供源…

    2022年6月6日
    33
  • 网络摄像头RTSP视频流WEB端实时播放实现方案[通俗易懂]

    网络摄像头RTSP视频流WEB端实时播放实现方案[通俗易懂]IPC视频流怎么实时在WEB浏览器播放,视频流格式是RTSP。下面我整理了自己实现的方案以及网上看到的一些方案一、FFmpeg+nginx将转hls通过video.js在支持h5浏览器播放(我实现的)参见:Nginx+FFmpeg实现rtsp流转hls流,在WEB通过H5video实现视频播放不足:hls延迟较rtmp、http-flv大二、FFmpeg+nginx-…

    2022年10月18日
    0

发表回复

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

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