Ubuntu 12.04 installation configuration uninstall jdk1.6

Source: Internet
Author: User

Http://hi.baidu.com/mengyancui/item/eb343435908cc19ab90c033a

1. Download and install

1. First go to http://www.oracle.com/technetwork/java/index.htmlto download the jdk1.6 Linux version, such as: jdk-6u20-linux-i586.bin;

2. Copy or cut the jdk-6u20-linux-i586.bin to/usr/local... (You can also put it in another directory );

3. CD/usr/local

Sudo chmod U + x jdk-6u20-linux-i586.bin

Sudo-S./jdk-6u20-linux-i586.bin;

4. Follow the prompts to operate ...... Installation complete;

2. Configure environment variables;

Method 1:

Enter the command sudo gedit/etc/profile (this is equivalent to modifying the system configuration file, which affects all users ),

Or sudo/home/user/. bashr, or bashrc. (Only for User Users)

Paste the following information in the last line of the pop-up file:
Export java_home =/usr/local/jdk1.6.0 _ 20
Export jre_home =/usr/local/jdk1.6.0 _ 20/JRE
Export classpath =.: $ java_home/lib: $ jre_home/lib: $ classpath
Export Path = $ java_home/bin: $ jre_home/bin: $ path

Method 2: Use the Export command, but this method only works for the current shell. It is invalid after the system is restarted or a new shell is opened.

After the machine is restarted, enter the following information in the terminal: Java-version, indicating that the installation and configuration are correct.

:~ $ Java-version
Java version "1.6.0 _ 20"
Java (TM) se Runtime Environment (build 1.6.0 _ 20-b02)
Java hotspot (TM) server VM (build 16.3-b01, mixed mode)

3. Uninstall JDK

1. Delete the JDK directory
Sudo Rm-RF/usr/local/jdk1.6.0 _ 20
2. Delete JDK Environment Variables
Sudo Vim/etc/profile
Export java_home =/usr/local/jdk1.6.0 _ 20
Export jre_home =/usr/local/jdk1.6.0 _ 20/JRE
Export classpath =.: $ java_home/lib: $ jre_home/lib: $ classpath
Export Path = $ java_home/bin: $ jre_home/bin: $ path
Save and exit.

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.