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


相关推荐

  • 数独口诀_数独技巧xwing推导过程

    数独口诀_数独技巧xwing推导过程数独是一种传统益智游戏,你需要把一个 9×9 的数独补充完整,使得图中每行、每列、每个 3×3 的九宫格内数字 1∼9 均恰好出现一次。请编写一个程序填写数独。输入格式输入包含多组测试用例。每个测试用例占一行,包含 81 个字符,代表数独的 81 个格内数据(顺序总体由上到下,同行由左到右)。每个字符都是一个数字(1−9)或一个 .(表示尚未填充)。您可以假设输入中的每个谜题都只有一个解决方案。文件结尾处为包含单词 end 的单行,表示输入结束。输出格式每个测试用例,输出一行数据,代表填充

    2022年8月9日
    4
  • pytest的使用_java中方法的调用

    pytest的使用_java中方法的调用Pytest执行用例规则Pytest在命令行中支持多种方式来运行和选择测试用例1.对某个目录下所有的用例pytest2.对模块中进行测试pytesttest_mod.py3.对文件夹进行

    2022年7月30日
    14
  • 说说 jBPM 工作流引擎的设计原理

    说说 jBPM 工作流引擎的设计原理1服务API设计jBPM4工作流引擎的核心PVM主要依靠4组服务API:流程定义服务-ProcessService。流程执行服务-ExecutionService。流程管理服务-ManagermentService。指令服务-CommandService。应用通过这些服务与PVM进行数据交互,这些都是在支持事务的持久化模式下运…

    2025年10月10日
    3
  • Telnet,SSH1,SSH2,Telnet/SSL,Rlogin,Serial,TAPI,RAW

    Telnet,SSH1,SSH2,Telnet/SSL,Rlogin,Serial,TAPI,RAW

    2022年1月13日
    54
  • 1.1音响系统放大器设计

    1.1音响系统放大器设计​⑴了解集成功率放大器内部电路工作原理;​​⑵掌握其外围电路的设计与主要性能参数的测试方法;​​⑶掌握用运放与功率管设计音频功率放大电路的方法;​​(4)掌握运用电路仿真软件进行模拟电路辅助设计的方法;

    2022年5月8日
    44
  • protostuff java_protostuff

    protostuff java_protostuff软件简介protostuff是一个支持各种格式的一个序列化Java类库,包括JSON、XML、YAML等格式。示例代码:publicclassUserSchemaimplementsSchema{publicbooleanisInitialized(Useruser){returnuser.getEmail()!=null;}publicvoidmergeFrom(In…

    2022年5月2日
    41

发表回复

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

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