Loading and unloading switch of JDK under Linux

Source: Internet
Author: User
Tags gz file

Tagged with: code too bin str ORC file CTI BSP 6.2

1. 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:

1 only jdk-6u45-linux-i586-rpm.bin files under the initial folder:2[Email protected] jdk-6u45]# ll3Total dosage 670364-rwxr-xr-x. 1 root root 68637258 July 15:11 jdk-6u45-linux-i586-Rpm.bin5 6 assigning permissions to the. bin file for execution7[Email protected] jdk-6u45]# chmod +x jdk-6u45-linux-i586-Rpm.bin8 9 Ten execute the. bin file One[Email protected] jdk-6u45]#./jdk-6u45-linux-i586-Rpm.bin A Unpacking ... - checksumming ... - Extracting ... theUnzipsfx 5.50 of February 2002, by Info-zip (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 Ainflating:sun-javadb-javadoc-10.6.2-1.1. i386.rpm atPreparing ... ########################################### [100%] -1:JDK ########################################### [100%] - unpacking JAR files ... - Rt.jar ... - Jsse.jar ... - Charsets.jar ... in Tools.jar ... - Localedata.jar ... to Plugin.jar ... + Javaws.jar ... - Deploy.jar ... the   * Done . $[Email protected] jdk-6u45]#Panax Notoginseng  - files under current folder: the[Email protected] jdk-6u45]# ll +Total dosage 134524 A-rw-r--r--. 1 root root 58463270 March jdk-6u45-linux-i586.rpm the-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 the[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.

1 [[email protected] java]# vim/etc/profile2 After entering the file, add Java_home,classpath,path configuration.  3 export java_home=/usr/java/jdk1.6. 0_454 export classpath= $CLASSPATH: $JAVA _home/ Lib: $JAVA _home/jre/lib5 export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH: $HOME/bin
6 after saving the exit file, execute the command to make the file effective
7 [[email protected] java]# Source/etc/profile

b). tar.gz bag

1 unzip the. tar.gz file: 2 [[email protected] jdk-8u144]# tar-zxvf jdk-8u144-linux-i586.tar.gz34 extracted files moved to /usr/java/ :5 [[email protected] jdk-8u144]# mv jdk1.8.0_144//usr/java/67 Modify/etc /profile file, configure environment variables, add Java_home,classpath,path path, make 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.

1initial contains. rpm Package Files:2[Email protected] jdk-7u80]# ll3Total dosage 1335724-rw-r--r--. 1 root root 136775360 July 19:29 jdk-7u80-linux-i586.rpm5 6 installing using the RPM command7[Email protected] jdk-7u80]# RPM-IVH jdk-7u80-linux-i586.rpm8Preparing ... ########################################### [100%]91:JDK ########################################### [100%]Ten unpacking JAR files ... One Rt.jar ... A Jsse.jar ... - Charsets.jar ... - Tools.jar ... the Localedata.jar ... - Jfxrt.jar ... - Plugin.jar ... - Javaws.jar ... + Deploy.jar ... -[Email protected] jdk-7u80]# +  A The current folder does not produce new files at[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 installation , the RPM should not is used directly install RPM packages, using Alien instead! This error, execute the following command:

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

3. Uninstall the JDK under Linux:

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

1 First look at the currently installed JDK information: 2 [root[email protected] jdk-7u80]# Rpm-qa | grep jdk 3 jdk-1.7.0_80-fcs.i5864 [[email protected] jdk-56  Uninstall installed JDK:7 [[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 Enter/usr/java directory 2 [[email protected] java]# cd/usr/java/34  Delete the extracted JDK files 5 [[email protected] java]# RM-RF jdk1.8.0_144/

c) Uninstallation of the system's own JDK:

1  to view your own JDK:2[Email protected]/]# Rpm-qa |grep jdk3 or:4[Email protected]/]# Rpm-qa |grep gcj5 6 results may be obtained:7jdk-1.7.0_80-fcs.i5868 9 Uninstall:Ten[Email protected]/]# rpm-e–nodeps jdk-1.7.0_80-fcs.i586 One or: A[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.