"Linux" Ubuntu installation Jdk-6u45-linux-x64.bin

Source: Internet
Author: User

for:android4.4 Source Code Compilation

Environment: UBUNTU12.04_DESKTOP_AMD64

1.

1.1. Jdk-6u45-linux-x64.bin placed in/home

1.2. Command "./jdk-6u45-linux-x64.bin"//This step is to unzip the file (if not superuser privileges, need to access the Jdk-6u45-linux-x64.bin settings)

1.3, environment variable settings: (file "/etc/environment")

1.3.1, open/etc/environment file (sudo gedit/etc/environment)

1.3.2, adding environment variables, separated by colons

Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/jdk1.6.0_45/bin"
Java_home= "/home/jdk1.6.0_45"
Classpath= "/home/jdk1.6.0_45/lib"

Path is used to specify the search path for the command, because we want to use the command in the Jdk/bin directory, so we need to add the path to the environment variable path;

The classpath is used to specify the class search path;

Java_home points to the JDK's installation directory, and by setting up Java_home, there is no need for Java configuration in eclipse.

1.3.3, execute Update command

$ sudo update-alternatives--install/usr/bin/java Java/home/jdk1.6.0_45/bin/java 300
$ sudo update-alternatives--install/usr/bin/javac Javac/home/jdk1.6.0_45/bin/javac 300
$ sudo update-alternatives--install/usr/bin/jar Jar/home/jdk1.6.0_45/bin/jar 300
$ sudo update-alternatives--install/usr/bin/javah javah/home/jdk1.6.0_45/bin/javah 300
$ sudo update-alternatives--install/usr/bin/javadoc javadoc/home/jdk1.6.0_45/bin/javadoc 300
$ sudo update-alternatives--install/usr/bin/javap JAVAP/HOME/JDK1.6.0_45/BIN/JAVAP 300
(Note that the 6-line command--install followed by a total of four parameters is the link name path priority, we just modify the corresponding path is OK)

ZC: It seems that JAVA/JAVAC/JAR/JAVAH/JARDOC/JAVAP can also be set by a command similar to the following: (However, I do not use them here, test it later)
sudo ln-s-f/home/jdk1.6.0_45/bin/jar
sudo ln-s-f/home/jdk1.6.0_45/bin/javah
sudo ln-s-f/home/jdk1.6.0_45/bin/jardoc

1.3.4, if there is more than one Java in the system (such as a different version or Openjava, etc.), you need to perform:

Update-alternatives--config Java
Use this step to select the system default JDK

1.4, if necessary, restart the OS

"Linux" Ubuntu installation Jdk-6u45-linux-x64.bin

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.