Install JDK 6 on Ubuntu12.04LTS

Source: Internet
Author: User
Installing JDK 6 on Ubuntu12.04LTS is not complicated, but the latest version of Ubuntu does not support installation through apt-get. Therefore, you need to download the installation package from the official Oracle website for installation. In fact, JDK7 has been released in Oracle. The reason for JDK6 installation is that TI's Androiddevkit3.0.0 must be specified to use JDK6 when compiling rootfs. There is a way, only JDK 6 can be used. The installation process is as follows: STEP

Installing JDK 6 on Ubuntu 12.04 LTS is not complicated, but the latest version of Ubuntu does not support installation through apt-get. Therefore, you need to download the installation package from the official Oracle website for installation.

In fact, JDK7 has been released in Oracle. The reason for installing JDK 6 is that when compiling rootfs, TI Android devkit 3.0.0 must specify JDK 6. There is a way, only JDK 6 can be used.

The installation process is as follows:

STEP 1: Download the JDK 6 installation package

Oracle official download link: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Download Java SE 6 Update 33, A jdk-6u33-linux-i586.bin-format file, about 68 MB.

STEP 2: Install JDK 6

1. Add execution permissions for jdk-6u33-linux-i586.bin

Chmod u + x/usr/lib/jvm/java/jdk-6u33-linux-i586.bin

2. Execute the jdk-6u33-linux-i586.bin and unpack the related files of JDK 6 to the directory of JDK 1.6.0 _ 33.

/Jdk-6u33-linux-i586.bin

3. Copy jdk1.6.0 _ 33 to/usr/lib.

Mkdir-p/usr/lib/jvm/

Cp-r jdk1.6.0 _ 33/usr/lib/jvm/jdk1.6.0 _ 33

4. Install JDK 6

There are many executable commands in the binfile of JDK 6. You can install them in the/usr/bin directory as needed. For example, I installed four commands: java/javac/javaws/jar. Run the following command:

Update-alternatives -- install/usr/bin/javac/usr/lib/jvm/jdk1.6.0 _ 33/bin/javac 1

Update-alternatives -- install/usr/bin/java/usr/lib/jvm/jdk1.6.0 _ 33/bin/java 1

Update-alternatives -- install/usr/bin/javaws/usr/lib/jvm/jdk1.6.0 _ 33/bin/javaws 1

Update-alternatives -- install/usr/bin/jar/usr/lib/jvm/jdk1.6.0 _ 33/bin/jar 1

Update-alternatives -- config javac

Update-alternatives -- config java

Update-alternatives -- config javaws

Update-alternatives -- config jar

Note: To install other commands, follow the preceding format and add them as needed.

5. Test

Run java-version to view the current JDK version, indicating that the installation is successful. Shown as follows:

Root @ ubuntu :~ /JDK # java-version

Java version "1.6.0 _ 33"

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

Java HotSpot (TM) Server VM (build between 8-b03, mixed mode)

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.