Installing Oracle JDK under Ubuntu Linux

Source: Internet
Author: User
Tags java se

from://http://blog.csdn.net/gobitan/article/details/24322561

installing Oracle JDK under Ubuntu LinuxDennis Hu 2014-4-22 Description:Because many systems do not support the use of OPENJDK, it is necessary to install Oracle JDK under Ubuntu. While the installation of Oracle JDK does not seem to provide the apt way, so the way to install Oracle JDK is relatively troublesome, I often install, in order to facilitate others at the same time to check, write it down. First step: differentiate between 32-bit or 64-bit operating systemsFirst determine whether your Ubuntu Linux is 32-bit or 64-bit, a lot of methods, here is a description. $uname-A Step Two: Uninstall OpenJDKRun the following command to see if OPENJDK is installed, and if it is already installed, the Java information will be displayed. $java-version If OPENJDK is installed, it can be uninstalled in the following ways: $sudo Apt-get purge openjdk-\* Step three: Download the Oracle JDK versionNote: Here is an example of Oracle 1.6 64-bit entry into http://www.oracle.com/technetwork/java/javasebusiness/downloads/ java-archive-downloads-javase6-419409.html, select Java SE development Kit 6u45, and then click Accept on the newly opened page Accept License Agreement". Once accepted, select "Jdk-6u45-linux-x64.bin" to download. If you are not logged in, the system will first go to the login page and enter the username and password you registered with the Oracle website. Step three: Install Oracle JDK(1) Create Java directory $ sudo mkdir-p/usr/local/java copy your downloaded Jdk-6u45-linux-x64.bin to/usr/local/java directory $ cd/usr/local/java$ sudo cp /home/dennis/downloads/jdk-6u45-linux-x64.bin. (2) Extract bin file $ sudo chmod +x jdk-6u45-linux-x64.bin$ sudo./jdk-6u45-linux-x64.bin$ sudo rm-rf jdk-6u45-linux-x64.bin Fourth Step: Configuring the Orache JDK(1) Configure the Java_home and PATH environment variables $ sudo vi/etc/profile at the end of the file with the following sections: java_home=/usr/local/java/jdk1.6.0_45
Path= $PATH: $HOME/bin: $JAVA _home/bin
Export Java_home
Export PATH (2) configures the location of Ubuntu JDK and JRE $ sudo update-alternatives--install "/usr/bin/java" "java" "/usr/local/java/ Jdk1.6.0_45/bin/java "1$ sudo update-alternatives--install"/usr/bin/javac "" Javac ""/usr/local/java/jdk1.6.0_45/bin /javac "1$ sudo update-alternatives--install"/usr/bin/javaws "" Javaws ""/usr/local/java/jdk1.6.0_45/bin/javaws "1 (3) Configure Oracle for system default jdk/jre$ sudo update-alternatives--set java/usr/local/java/jdk1.6.0_45/bin/java$ sudo Update-alternatives--set Javac/usr/local/java/jdk1.6.0_45/bin/javac
$ sudo update-alternatives--set javaws/usr/local/java/jdk1.6.0_45/bin/javaws After the configuration is complete, execute the following command to make it effective immediately. $ . /etc/profile perform the "java-version" display as follows: [Email protected]:~$ java-version
Java Version "1.6.0_45"
Java (TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot (TM) 64-bit Server VM (build 20.45-b01, Mixed mode) reference:

Installing Oracle JDK under Ubuntu Linux

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.