Install JDK manually on Ubuntu

Source: Internet
Author: User
Before installation, you can check the jdk version, enter the Ubuntu terminal $ java-version, and press Enter. You can see that the jdk version is 1.4.2. 1. Manually install JDK 6 first, download the http://java.sun.com in the jdk-6u12-linux-i586.bin, it is said that this operation is relatively simple, do not need to switch. Then, you can place it in any folder you like. If you are a cainiao like me, we suggest placing it in the main folder (/home /*)

Before installation, you can check the jdk version, enter the Ubuntu terminal $ java-version, and press Enter. You can see that the jdk version is 1.4.2.

1. Manually install JDK 6

First, download the http://java.sun.com in the jdk-6u12-linux-i586.bin, it is said that this operation is relatively simple, do not need to switch.

Then, you can place it in any folder you like. If you are a cainiao like me, it is recommended to put it under the main folder (/home.

Install jdk as follows:

Enter your jdk-6u12-linux-i586.bin under the terminal, for example, my location is:/home/liangshihong

$ Sudo-s./jdk-6u12-linux-i586.bin

Press enter until you are asked whether to install it. Enter yes and press Enter.

OK. After the installation is complete, configure the environment variables below.

Configure classpath and modify the environment variables of all users

$ Sudo gedit/etc/profile

Add at the end of the file

# Set java environment

JAVA_HOME =/home/liangshihong/jdk1.6.0 _ 12

Export JRE_HOME =/home/liangshihong/jdk1.6.0 _ 12/jre

Export CLASSPATH =.: $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH

Export PATH = $ JAVA_HOME/bin: $ JRE_HOME/bin: $ PATH

Restart the computer and run the command to test the jdk version.

Java-version

The following information is displayed: the installation is successful.

Java version "1.6.0 _ 12"

Java (TM) SE Runtime Environment (build 1.6.0 _ 12-b04)

Java HotSpot (TM) Server VM (build 11.2-b01, mixed mode)

Liangshihong @ liangshihong-Imagine :~ $

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.