Install Java offline in Ubuntu Linux and Uninstall Java

Source: Internet
Author: User

System: Ubuntu 10.04

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

1. Install JDK

1. Install JDK

 
Sudo chmod U + x jdk-6u16-linux-i586.bin sudo CP-A jdk-6u20-linux-i586.bin/OPT sudo/opt/jdk-6u20-linux-i586.bin sudo Rm-F/opt/jdk-6u20-linux-i586.bin

2. Set JDK Environment Variables

Add sudo gedit/etc/profileCode: # Set Java environment export java_home =/opt/jdk1.6.0 _ 20 export jre_home = $ java_home/JRE export classpath = $ classpath: $ java_home/lib: $ jre_home/lib export Path = $ path: $ java_home/bin: $ jre_home/bin save and exit.

3. Make the environment variable take effect immediately

 
Source/etc/profile: Save the settings; otherwise, restart the instance to take effect.

4. Test

 
Java-version if 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) is displayed) the installation is successful.

Ii. Uninstall JDK

1. Delete the JDK directory

 
Sudo Rm-RF/opt/jdk1.6.0 _ 20

 
Sudo gedit/etc/profile deletion code: # Set Java environment export java_home =/opt/jdk1.6.0 _ 20 export jre_home = $ java_home/jreexport classpath = $ classpath: $ java_home/lib: $ jre_home/libexport Path = $ path: $ java_home/bin: $ jre_home/bin 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.