• linux安装Jdk


    最简单的方法:yum install java-1.8.0-openjdk* -y

    安装jdk的方法(Bin型)**************************************************************

    将jdk-6u39-linux-x64.bin拷贝到/D/programfiles/下
    修改权限: chmod +x jdk-6u39-linux-x64.bin
    运行Bin: ./jdk-6u39-linux-x64.bin
    重命名文件夹: mv jdk1.6.0_39 Jdkx64

    安装jdk的方法(RpmBin型)***********************************************************

    首先,下载好jdk的Linux版本安装包jdk-6u33-linux-i586-rpm.bin

    修改权限:chmod +x jdk-6u33-linux-i586-rpm.bin
    解压并安装包:./jdk-6u33-linux-i586-rpm.bin

    安装过程如下,尽然是全自动化的:
    [root@localhost java]# ./jdk-6u33-linux-i586-rpm.bin

    Unpacking...
    Checksumming...
    Extracting...
    UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
      inflating: jdk-6u33-linux-i586.rpm 
      inflating: sun-javadb-common-10.6.2-1.1.i386.rpm 
      inflating: sun-javadb-core-10.6.2-1.1.i386.rpm 
      inflating: sun-javadb-client-10.6.2-1.1.i386.rpm 
      inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm 
      inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm 
      inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm 
    Preparing...                ########################################### [100%]
       1:jdk                    ########################################### [100%]
    Unpacking JAR files...
            rt.jar...
            jsse.jar...
            charsets.jar...
            tools.jar...
            localedata.jar...
            plugin.jar...
            javaws.jar...
            deploy.jar...
    Installing JavaDB
    Preparing...                ########################################### [100%]
       1:sun-javadb-common      ########################################### [ 17%]
       2:sun-javadb-core        ########################################### [ 33%]
       3:sun-javadb-client      ########################################### [ 50%]
       4:sun-javadb-demo        ########################################### [ 67%]
       5:sun-javadb-docs        ########################################### [ 83%]
       6:sun-javadb-javadoc     ########################################### [100%]
    
    Java(TM) SE Development Kit 6 successfully installed.
    
    Product Registration is FREE and includes many benefits:
    * Notification of new versions, patches, and updates
    * Special offers on Oracle products, services and training
    * Access to early releases and documentation
    
    Product and system data will be collected. If your configuration
    supports a browser, the JDK Product Registration form will
    be presented. If you do not register, none of this information
    will be saved. You may also register your JDK later by
    opening the register.html file (located in the JDK installation
    directory) in a browser.
    
    For more information on what data Registration collects and
    how it is managed and used, see:
    http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html
    
    Press Enter to continue.....
    
    • 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
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50

    按回车继续:
    Done.
    检查新版本的jdk:
    [root@localhost java]# java -version
    java version “1.6.0_33”
    Java™ SE Runtime Environment (build 1.6.0_33-b04)
    Java HotSpot™ Client VM (build 20.8-b03, mixed mode, sharing)

    卸载Jdk******************************************************************************

    (1)卸载系统自带的jdk版本:
    查看自带的jdk:
    #rpm -qa | grep gcj
    看到类似如下信息:
    java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
    使用rpm -e --nodeps 命令删除上面查找的内容:
    (2)卸载rpm安装的jdk版本
    查看安装的jdk:
    #rpm -qa | grep jdk
    看到如下信息:
    jdk-1.6.0_22-fcs
    卸载:
    #rpm -e --nodeps jdk-1.6.0_22-fcs

    卸载Jdk方法二******************************************************************************

    (3)卸载jdk的另一种方法
    [root@localhost soft]# java -version
    java version “1.4.2”
    gij (GNU libgcj) version 4.1.2 20071124 (Red Hat 4.1.2-42)
    [root@localhost soft]# rpm -qa | grep jdk
    [root@localhost soft]# rpm -qa | grep gcj
    libgcj-4.1.2-42.el5
    java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
    上面先确认jdk的具体版本号,然后
    [root@localhost jdk1.6.0_11]# yum -y remove java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
    Setting up Remove Process
    Resolving Dependencies………(开始卸载)
    Removed: java-1.4.2-gcj-compat.i386 0:1.4.2.0-40jpp.115
    Dependency Removed: antlr.i386 0:2.7.6-4jpp.2 bsf.i386 0:2.3.0-11jpp.1 bsh.i386 0:1.3.0-9jpp.1
    gjdoc.i386 0:0.7.7-12.el5 hsqldb.i386 1:1.8.0.9-1jpp.2
    Complete!(卸载完成)

  • 相关阅读:
    【Qt之QStandardItemModel】使用,tableview、listview、treeview设置模型
    Python股票量化投资课学习—单均线双均线策略
    算法-手写LRU
    RocketMQ - Java 20220917
    怎么批量剪辑优质的快手短视频,教程来了,附图
    【JavaSE】继承那些事儿
    4.Autofac依赖注入初使用
    Uniapp 生命周期
    C++ 智能指针浅析
    深度学习遇到 DolphinDB AI DataLoader
  • 原文地址:https://blog.csdn.net/ice666_1/article/details/127674282