zoukankan      html  css  js  c++  java
  • Centos中yum方式安装java

    查看CentOS自带JDK是否已安装

    1

    [root@test ~]# yum list installed |grep java

    若有自带安装的JDK,应如下操作进行卸载CentOS系统自带Java环境

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    [root@test ~]# java -version

    java version "1.7.0_181"

    OpenJDK Runtime Environment (rhel-2.6.14.8.el6_9-x86_64 u181-b00)

    OpenJDK 64-Bit Server VM (build 24.181-b00, mixed mode)

    [root@test ~]# yum -y remove java-1.7.0-openjdk*

    [root@test ~]# yum -y remove tzdata-java.noarch

    [root@test ~]# java -version

    -bash/usr/bin/java: No such file or directory

    查看yum库中的Java安装包

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    29

    30

    31

    32

    33

    34

    35

    36

    37

    38

    39

    40

    41

    42

    43

    44

    [root@test ~]# yum -y list java*

    Loaded plugins: fastestmirror

    Loading mirror speeds from cached hostfile

    * base: centos.ustc.edu.cn

    * extras: centos.ustc.edu.cn

    * updates: centos.ustc.edu.cn

    base | 3.7 kB 00:00

    extras | 3.4 kB 00:00

    updates | 3.4 kB 00:00

    Available Packages

    java-1.5.0-gcj.x86_64 1.5.0.0-29.1.el6 base

    java-1.5.0-gcj-devel.x86_64 1.5.0.0-29.1.el6 base

    java-1.5.0-gcj-javadoc.x86_64 1.5.0.0-29.1.el6 base

    java-1.5.0-gcj-src.x86_64 1.5.0.0-29.1.el6 base

    java-1.6.0-openjdk.x86_64 1:1.6.0.40-1.13.12.6.el6_8 updates

    java-1.6.0-openjdk-demo.x86_64 1:1.6.0.40-1.13.12.6.el6_8 updates

    java-1.6.0-openjdk-devel.x86_64 1:1.6.0.40-1.13.12.6.el6_8 updates

    java-1.6.0-openjdk-javadoc.x86_64 1:1.6.0.40-1.13.12.6.el6_8 updates

    java-1.6.0-openjdk-src.x86_64 1:1.6.0.40-1.13.12.6.el6_8 updates

    java-1.7.0-openjdk.x86_64 1:1.7.0.111-2.6.7.2.el6_8 updates

    java-1.7.0-openjdk-demo.x86_64 1:1.7.0.111-2.6.7.2.el6_8 updates

    java-1.7.0-openjdk-devel.x86_64 1:1.7.0.111-2.6.7.2.el6_8 updates

    java-1.7.0-openjdk-javadoc.noarch 1:1.7.0.111-2.6.7.2.el6_8 updates

    java-1.7.0-openjdk-src.x86_64 1:1.7.0.111-2.6.7.2.el6_8 updates

    java-1.8.0-openjdk.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-debug.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-demo.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-demo-debug.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-devel.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-devel-debug.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-headless.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-headless-debug.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-javadoc.noarch 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-javadoc-debug.noarch 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-src.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java-1.8.0-openjdk-src-debug.x86_64 1:1.8.0.101-3.b13.el6_8 updates

    java_cup.x86_64 1:0.10k-5.el6 base

    java_cup-javadoc.x86_64 1:0.10k-5.el6 base

    java_cup-manual.x86_64 1:0.10k-5.el6 base

    javacc.x86_64 4.1-0.5.el6 base

    javacc-demo.x86_64 4.1-0.5.el6 base

    javacc-manual.x86_64 4.1-0.5.el6 base

    javassist.noarch 3.9.0-6.el6 base

    javassist-javadoc.noarch 3.9.0-6.el6 base

    以yum库中java-1.8.0为例, "*"表示将java-1.8.0的所有相关Java程序都安装上

    1

    [root@test ~]# yum -y install java-1.8.0-openjdk*

    查看刚安装的Java版本信息。
    输入:"java -version" 可查看Java版本
    输入:"javac" 可查看Java的编译器命令用法

  • 相关阅读:
    python接口之request测试:以json格式发送post请求,.json方法,查看响应结果的情况
    python字典转化成json格式。JSONEncoder和JSONDecoder两个类来实现Json字符串和dict类型数据的互相转换
    webservice接口测试wsdl,参数是xml格式。python,入参转化成str,返回值转化成dict调用
    jenkins配置自动发送邮件,抄送
    让 Python 的1、数据库查询返回字典记录--- 2、利用zip函数将两个列表(list)组成字典(dict)
    如何从日期对象python获取以毫秒(秒后3位小数)为单位的时间值?
    Python之测试webservice接口
    eclipese pyDEV安装----可以直接运行python文件
    jenkins安装与配置---windows系统,war直接运行
    python pip 安装第三方库 mysql模块步骤--pip install mysql-connector-python
  • 原文地址:https://www.cnblogs.com/Python-K8S/p/13410203.html
Copyright © 2011-2022 走看看