Loading and unloading switch of JDK under Linux

Source: Internet
Author: User
Tags gz file

  • installation package for Linux under JDK:
  • A). Bin Package (Jdk-6u45-linux-i586-rpm.bin)

    b). tar.gz Bag (jdk-8u144-linux-i586.tar.gz)

    c). RPM Package (jdk-7u80-linux-i586.rpm)

    2.Linux installation of the JDK:

    A). bin package:

    Only jdk-6u45-linux-i586-rpm.bin files under the initial folder:

    [email protected] jdk-6u45]# LL

    Total dosage 67036

    -rwxr-xr-x. 1 root root 68637258 July 15:11 jdk-6u45-linux-i586-rpm.bin

    assigning permissions to the. bin file for execution

    [Email protected] jdk-6u45]# chmod +x jdk-6u45-linux-i586-rpm.bin

    9

    Execute the. bin file

    [Email protected] jdk-6u45]#./jdk-6u45-linux-i586-rpm.bin

    Unpacking ...

    Checksumming ...

    Extracting ...

    Unzipsfx 5.50 of February 2002, by Info-zip ([email protected]).

    inflating:jdk-6u45-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...

    Done.

    [Email protected] jdk-6u45]#

    Files under current folder:

    [email protected] jdk-6u45]# LL

    Total dosage 134524

    -rw-r--r--. 1 root root 58463270 March jdk-6u45-linux-i586.rpm

    -rwxr-xr-x. 1 root root 68637258 July 15:11 jdk-6u45-linux-i586-rpm.bin

    -rw-r--r--. 1 root root 499375 November 3 sun-javadb-client-10.6.2-1.1.i386.rpm

    -rw-r--r--. 1 root root 14627 November 3 sun-javadb-common-10.6.2-1.1.i386.rpm

    -rw-r--r--. 1 root root 4080625 November 3 sun-javadb-core-10.6.2-1.1.i386.rpm

    -rw-r--r--. 1 root root 969861 November 3 sun-javadb-demo-10.6.2-1.1.i386.rpm

    -rw-r--r--. 1 root root 4865183 November 3 sun-javadb-docs-10.6.2-1.1.i386.rpm

    -rw-r--r--. 1 root root 201273 November 3 sun-javadb-javadoc-10.6.2-1.1.i386.rpm

    [Email protected] jdk-6u45]#

    After execution, the Java directory is automatically generated in the/usr/directory, and the JDK information is included in the Java directory. Finally, you can modify the/etc/profile file.

    [Email protected] java]# Vim/etc/profile

    After entering the file, add the Java_home,classpath,path configuration.

    Export java_home=/usr/java/jdk1.6.0_45

    Export classpath= $CLASSPATH: $JAVA _home/lib: $JAVA _home/jre/lib

    Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH: $HOME/bin

    After saving the exit file, execute the command to make the file effective

    [Email protected] java]# Source/etc/profile

    b). tar.gz bag

    Unzip the. tar.gz file:

    [Email protected] jdk-8u144]# TAR-ZXVF jdk-8u144-linux-i586.tar.gz

    The extracted files are moved to/usr/java/:

    [Email protected] jdk-8u144]# MV jdk1.8.0_144//usr/java/

    Modify the/etc/profile file, configure the environment variables, add the Java_home,classpath,path path, make the file effective, ibid.

    Note: If the Java directory does not exist under the/usr directory, the Java directory will be created automatically using the MV jdk1.8.0_144//usr/java/command, but there will be no jdk1.8.0_144/directory, just jdk1.8.0_ The files in the 144 directory are moved to the/usr/java/directory, and if a Java directory exists before the command is used, the jdk1.8.0_144/directory is moved to the/usr/java/directory as a whole.

    c). RPM Package

    When installing the JDK using the. bin package, the command will produce a. rpm file that can be used as an installation file or downloaded from Oracle.

    Initial contains. rpm Package Files:

    [email protected] jdk-7u80]# LL

    Total dosage 133572

    -rw-r--r--. 1 root root 136775360 July 19:29 jdk-7u80-linux-i586.rpm

    Installing using the RPM command

    [Email protected] jdk-7u80]# RPM-IVH jdk-7u80-linux-i586.rpm

    Preparing ... ########################################### [100%]

    1:JDK ########################################### [100%]

    Unpacking JAR files ...

    rt.jar...jsse.jar...charsets.jar...tools.jar...localedata.jar...jfxrt.jar...plugin.jar...javaws.jar...deploy.jar...

    [Email protected] jdk-7u80]#

    The current folder does not produce new files

    [email protected] jdk-7u80]# LL

    Total dosage 133572

    -rw-r--r--. 1 root root 136775360 July 19:29 jdk-7u80-linux-i586.rpm

    As with the. bin package installation, after executing the command, the Java directory is automatically created under the/usr/directory, the JDK information is placed in the JDK directory, and the configuration Java_home,classpath,path is configured in/etc/profile.

    If you use the RPM-IVH jdk-7u80-linux-i586.rpm command to install the RPM should not be used directly install RPM packages, using Alien instead! this error, perform The following commands can:

    RPM-IVH jdk-6u22-linux-i586.rpm--nodeps--force.

      1. Uninstallation of the JDK under Linux:

    A). bin package installation and. RPM Package installed JDK Uninstall:

    First look at the currently installed JDK information:

    [Email protected] jdk-7u80]# Rpm-qa | grep JDK

    jdk-1.7.0_80-fcs.i586

    [Email protected] jdk-7u80]#

    To uninstall the installed JDK:

    [Email protected] jdk-7u80]# rpm-e--nodeps jdk-1.7.0_80-fcs.i586

    b). tar.gz Package installed JDK Uninstall:

    Remove the unpacked installation package directly.

    1 entering the/usr/java directory 2

    [Email protected] java]# cd/usr/java/

    Delete the extracted JDK files 5[[email protected] java]# RM-RF jdk1.8.0_144/

    c) Uninstallation of the system's own JDK:

    To view your own JDK:

    [Email protected]/]# Rpm-qa | grep JDK

    Or:

    [Email protected]/]# Rpm-qa | grep GCJ

    Results may be obtained:

    jdk-1.7.0_80-fcs.i586

    Unloading:

    [Email protected]/]# rpm-e–nodeps jdk-1.7.0_80-fcs.i586

    Or:

    [Email protected]/]# ryum-y Remove jdk-1.7.0_80-fcs.i586

    Loading and unloading switch of JDK under Linux

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.