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 javajdk, because a lot of information on the Internet is outdated. The following describes how to install and configure JDK in Ubuntu12.04LTS. It is not complex to install JDK 6 on Ubuntu12.04LTS. However, Ubuntu of later versions does not support direct use of apt-
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 @ linuxidc :~ # 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 <选定的软件包>
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.linuxidc.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.
Reading:
Install JDK 7 (with Clojure download) http://www.linuxidc.com/Linux/2012-10/71557.htm under Ubuntu
Install JDK1.7 http://www.linuxidc.com/Linux/2012-06/62239.htm in Ubuntu 12.04
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2