Java version Installation

Source: Internet
Author: User

System: Ubuntu 10.04

Jdk:jdk-6u20-linux-i586.bin

Of course, I have downloaded the necessary JDK on the Sun's official website, because it is installed under Linux, and is different from the usual windows, specially recorded.

I. Installing the JDK

1. Installing the JDK

    1. sudo chmod u+x jdk-6u16-linux-i586.bin
    2. sudo cp-a jdk-6u20-linux-i586.bin/opt
    3. Sudo/opt/jdk-6u20-linux-i586.bin
    4. sudo rm-f/opt/jdk-6u20-linux-i586.bin

2. Setting the JDK environment variable

    1. sudo gedit/etc/profile
    2. Add code:
    3. #set Java Environment
    4. Export JAVA_HOME=/OPT/JDK1.6.0_20
    5. Export Jre_home= $JAVA _home/jre
    6. Export classpath= $CLASSPATH: $JAVA _home/lib: $JRE _home/lib
    7. Export path= $PATH: $JAVA _home/bin: $JRE _home/bin
    8. Save exit.

3. Rebooting the system

4. Test whether the installation is successful

    1. Java-version
    2. If the display
    3. Java Version "1.6.0_20"
    4. Java (TM) SE Runtime Environment (build 1.6.0_20-b02)
    5. Java HotSpot (TM) Server VM (build 16.3-b01, Mixed mode)
    6. The installation succeeds.

Two. Uninstalling the JDK

1. Delete the JDK directory

    1. sudo rm-rf/opt/jdk1.6.0_20

2. Delete JDK Environment variables

    1. sudo gedit/etc/profile
    2. Delete code:
    3. #set Java Environment
    4. Export JAVA_HOME=/OPT/JDK1.6.0_20
    5. Export Jre_home= $JAVA _home/jre
    6. Export classpath= $CLASSPATH: $JAVA _home/lib: $JRE _home/lib
    7. Export path= $PATH: $JAVA _home/bin: $JRE _home/bin
    8. Save exit.
Top
0
Step

Java version Installation

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.