JDK version upgrades for Linux systems

Source: Internet
Author: User


First, jdk1.4 Uninstall

Redhat Enterprise 5 has installed the jdk1.4, before installing the jdk1.6, the jdk1.4 uninstall:

1. First look at the JDK version that comes with your system:

[Email protected] ~]# java-version

Java Version "1.4.2"
Gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48)

Copyright (C) 2006 free Software Foundation, Inc.
This was free software;  See the source for copying conditions. There is NO
Warranty Not even to merchantability or FITNESS for A particular PURPOSE.

2. Determine the specific version number of the JDK and then uninstall it:

[Email protected] ~]# Rpm-qa | grep JDK
[Email protected] ~]# Rpm-qa | grep GCJ
Libgcj-4.1.2-42.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
First, confirm the specific version number of the JDK, and then use the RPM-E--nodeps command to delete what you found above:

#rpm-E--nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115

complete!

3. Check the JDK version again to uninstall the success:

[Email protected] ~]# java-version

-bash:./usr/bin/java:no such file or directory

Second, jdk1.6 installation

Start manually installing the latest jdk1.6 Version,jdk-6u33-linux-i586.bin

1. Assign permissions to Jdk-6u33-linux-i586.bin, specifically to give it permission to execute
[Email protected] ~]# chmod +x jdk-6u33-linux-i586.bin

2. Then unzip:./jdk-6u33-linux-i586.bin
[Email protected] ~]#./jdk-6u33-linux-i586.bin

3. After the implementation there will be a bunch of agreement or something, all the way down. Then there is a confirmation installation, enter Yes, and then enter. Start unpacking. One until

Java (TM) SE Development Kit 6 successfully installed.
.........
Press Enter to continue .....
Done.

4. The extracted files are as follows:
[[email protected] ~]# ls
Jdk1.6.0_33 Jdk-6u33-linux-i586.bin

5. The installation files are generally placed under usr/local to perform copies:
[Email protected] ~]# MV Jdk1.6.0_33/usr/local
[Email protected] ~]# cd/usr/local
[[email protected] local]# ls
Bin etc games include jdk1.6.0_33 Lib libexec sbin share src

6. The JDK has been successfully transported to the/usr/local, then the final step, setting the environment variables.

7. There are two kinds of settings, one is the temporary effect through the export settings, after restarting the settings will be lost, one is to write the settings to the/etc/profile file, can be effective. So, the best setting is of course written in the file. Execute the following command first:
[Email protected] local]# Vi/etc/profile

8. After opening the profile file, enter I into insert mode and add the following on the last side of the file.
Export Java_home= "/usr/local/jdk1.6.0_33"
Export class_path= "$JAVA _home/lib: $JAVA _home/jre/lib"
Export Path= ".: $PATH: $JAVA _home/bin"
Then ESC, enter: Wq, save exit.

9. Then you need to set the changes to take effect:
[Email protected] local]# Source/etc/profile

Of course, if you like to restart, you can reboot.

10. View the current JDK version.

[Email protected] local]# java-version

Java Version "1.6.0_33"
Java (TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot (TM) Client VMs (build 20.8-b03, mixed mode, sharing)

Installation is complete!


JDK version upgrades for Linux systems

Related Article

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.