How to install Oracle Java 7 (JDK) In ubuntu (or linuxdeepin12)

Source: Internet
Author: User
As you probably know, Oracle Java (JVM/JDK) will not be available in the Debian/Ubuntu repositories anymore because Oracle retired the "Operating System distributor license for Java" (Jdl) and the only release available in the repositories will be openjdk.

But of course, Oracle Java can still be downloaded from its website if you really need it and don't want to use openjdk:

 

Linux users who prefer to use the thoroughly tested Oracle JDK 6 or Oracle JDK 7 binaries over openjdk builds packaged in their Linux distributions of choice can of course as usual simply get the gratis download at http://oracle.com/java under the same terms as users on other platforms.

-More Info @ robilad

 

However, installing it in Ubuntu is not that easy, so here is how to install the latest sun Oracle Java JDK 7 (at the time I'm writing this post) In ubuntu.

 

 

 

Install Oracle Java JDK 7 in Ubuntu

Warning: JDK 7 is available as a Developer Preview release, so use it at your own risk.

For the installation we'll be using an old script created by webupd8 reader Bruce ingils which I 've updated to work with the latest Oracle JDK 7 (just a minor modification ). the installation instructions below only work for Oracle JDK.

Let's begin!

1. download the latest Oracle JDK 7 from here(You must click "accept license" and then download the .tar.gz package for your computer architecture-jdk-7-linux-i586.tar.gz or jdk-7-linux-x64.tar.gz; these filenames are just examples, they will change on future releases ). you can use these instructions for older JDK versions too, but make sure you use the appropriate folder names, etc.

2. Extract the downloaded Oracle Java JDK archive in your home folder and rename the newly created folder to "Java-7-Oracle"-We must move this folder/Usr/lib/JVMUsing the following commands:

 

$ Cd
$ Sudo mkdir-P/usr/lib/JVM/# just in case
$ Sudo MV Java-7-Oracle // usr/lib/JVM/

 

 

3. Install update Java package created by Bruce ingils (packages available for Ubuntu 11.10, 11.04, 10.10 and 10.04 ):

 

$ Sudo add-Apt-repository PPA: nilarimogard/webupd8
$ Sudo apt-Get update
$ Sudo apt-Get Install update-Java

 

 

If you don't want to add the webupd8 PPA, you can also manually download the script. The script may work with other Linux distributions, but it has only been tested on Ubuntu.

4. Now run the following command in a terminal to install Oracle Java JDK:

 

$ Sudo Update-Java

 

 

The script will ask you to select the Java version-Select "Java-7-Oracle" for Oracle Java JDK 7, click OK and wait for it to finish:

After a few minutes, Oracle Java JDK shoshould be successfully installed on your Ubuntu machine. You can check out the version by running these commands in a terminal:

$ Java-version
$ Javac-version

 

The version shoshould be "1.7.0 ".

 

 

Original article address:

 

Http://www.webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html

 

 

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.