Ubuntu 12.04 LTS installation and configuration JDK1.6.0 _ 45

Source: Internet
Author: User

Recently, we need to compile the source code of the Android system and install Ubuntu. However, there was no linux foundation before, so it took a lot of time to install java jdk, because a lot of information on the Internet is outdated. The following describes how to install and configure JDK in Ubuntu 12.04 LTS.

It is not complicated to install JDK 6 on Ubuntu 12.04 LTS, however, the latest version of Ubuntu does not support installation through apt-get (I have been studying this before! _!). 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.

Enter the following command:

Java-version

The following content is output:

Root @ haiyang-Aspire :~ # Java-version
The 'java' program is included in the following software packages:
* Default-jre
* Gcj-4.6-jre-headless
* Openjdk-6-jre-headless
* Gcj-4.5-jre-headless
* Openjdk-7-jre-headless
Please try: apt-get install <selected software package>

It indicates that jdk has not been installed. Go to Oracle to download the JDK compressed package under Linux, http://www.oracle.com/technetwork/java/javase/downloads/index.html, and decompress it directly.

1. Download The JDK6 installation package, my 64-bit system so select jdk-6u45-linux-x64.bin

: Http://www.oracle.com/technetwork/java/javase/downloads/index.html

2, unzip the jdk-6u45-linux-x64.bin, decompress the corresponding jdk-6u45 folder, the command is:

$ Chmod u + x jdk-6u45-linux-x64.bin
$./Jdk-6u45-linux-x64.bin

3, and then move the decompressed jdk-6u45 folder to/usr/lib, enter the current directory where the jdk folder is stored, move the unzipped jdk-6u45 folder to the/usr/lib/jvm directory with the highest permissions, and execute the following command even if there is no jvm directory, the jvm folder will be created.

$ Sudo mkdir-p/usr/lib/jvm/(optional)
$ Sudo mv jdk-6u45/usr/lib/jvm/

After the installation, set the environment variable to enter the main folder of the current user name and modify the. profile file. Note: This file is the configuration file of the current user. To take effect for all users on the computer, set the file to/etc/profile. Enter the following command:

Sudo gedit ~ /. Profile

Add:

Export JAVA_HOME =/usr/lib/jvm/jdk-6u45
Export JRE_HOME =/usr/lib/jvm/jdk-6u45/jre
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib: $ JRE_HOME/lib: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ PATH

Then save and close it. If you enter java-version in the command line, the system still shows that java is not installed. In this case, use source to update the. profile file and enter the following command:

$ Source ~ /. Profile

Use the java-version command again to see the following output:

Www.linuidc.com @ linux :~ $ Java-version
Java version jdk-6u45"
Java (TM) SE Runtime Environment (build jdk-6u45-b18)
Java HotSpot (TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

At this point, the oracle jdk configuration has been completed.

Install JDK 7 In Ubuntu (with Clojure download)

Install JDK 12.04 in Ubuntu

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.