Most of the software is not thoroughly tested with Java 7 and I would like to install Oracle's JDK 6.0 on Ubuntu 11.10.
Could someone please provide me the instructions for the same?
Due to license issues Ubuntu will no longer distribute Oracle's JDK and JRE. Also previous versions supplied on PPAs suffer from security issues are are not recommended to be installed on any Ubuntu system.
There are no more supported java releases from Ubuntu - Ubuntu officially supports OpenJDK and OpenJRE implementation of Java which is the base for Oracle's own implementation.
To install the OpenJDK & OpenJRE refer to this Q&A.
The instructions below provide a guide to install the official Oracle JDK 6. You will need to regularly update this manually to ensure your installation maintains recommended security and stability fixes.
Install the Oracle JDK 6
Oracle themselves have the official guide to install their JDK - below is based upon those instructions.
During installation it will ask you to register - press ENTER. Firefox will open with the registration page. Registration is optional.
JDK 6 package is extracted into
Lets rename it:
switch to Oracle JDK 6
webupd8.googlecode.com hosts a nice-easy script to help with this.
don't worry - 0.5b refers to the script version - not the version of java!
An alternative to this is to use the webupd8 ppa and the
Finally test the switch has been successful:
These should display the oracle version installed - 1.6.0_30
In a terminal:
Remove the IcedTea plugin, if it has been installed.
Remove a former version of the Java plugin (may or may not be present)
Now you can install the plugin, by creating a symbolic link (you tell Firefox, where the plugin is located).
Confirm that the JRE has been successful by using the official oracle website.
The reason why Oracle's Java implementation is not supported or distributed by Ubuntu already discussed here.
The basic idea is that Oracle's Java Se will not be included in any official Ubuntu repo due to license problems created by Oracle.
That does not stop you from installing Oracle's JDK from a PPA or from the official package files from the Oracle's site.
This guide describes how-to download, install and make
How to install Oracle Java JDK6u30 on Ubuntu 11.10
(should work with any other version downloaded from Oracle)
Download Sun/Oracle Java JDK or JRE from here (current version is JDK 6 Update 30) http://www.oracle.com/technetwork/java/javase/downloads/index.html.
Note: Select any of the Linux x86 or Linux x64 bin packages (example
There will be a newly created folder on the same path with the extracted files
mkdir -p /usr/lib/jvm cd /path/to/binary/ mv /path/to/binary/jdk1.6.0_30 /path/to/binary/java-6-oracle && mv /path/to/binary/java-6-oracle /usr/lib/jvm/
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/java-6-oracle/bin/java" 1 sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-6-oracle/bin/javac" 1 sudo update-alternatives --install "/usr/bin/javaws" "java" "/usr/lib/jvm/java-6-oracle/bin/javaws" 1
sudo update-alternatives --config java
Select you created
sudo update-alternatives --config javac
Select you new created
sudo update-alternatives --config javaws
Select you new created
Navigate to the end of the file and add these contents
Reload your system wide PATH
That is for Oracle's JDK,
The version here installed can be updated easily by copying the new version over the currently installed files. Just extract the package and copy over the new one over the one that is currently installed.
You might want to check /etc/alternatives for links to older installs of JRE - there are many tools that might not be found on your system after a manual install like this.
|show 3 more comments|
Since Oracle Java has been removed from the repository, you will have to add a new repository like mentioned in this article. The repository described there has also packages for Oneiric.
Note: It's important to trust the repository/ppa you're installing from.
This could do anything.
So, if you trust the repository and developer below;
Script will build packages from source and place them in local repo, then they can be installed e.g.:
You can see all available packages in
Remember to select the right version:
To setup everything else (like browser plugin, keytool, etc.) you can use this (it will be a long list!):
The script is a wrapper for this Debian script, if you're curious ;)
I expect, that the ppa of ferramroberto might not be working in the future, because repackaging of java is not allowed any more. Unfortunately what is not allowed for canonical is also not allowed for any other packager. So the solution mentioned above might be the only way (which is basically a wrapper for update-alternatives!):
It is generally a good idea, to get an oracle account and get the java newsletter to be informed about software updates until a solution comes along the way for us ubuntu users to be informed about updates.
In many cases it is not necessary to switch over to Oracle Java (or any other alternative version) completely. Many applications that require something other than the standard Java version can be started by explicitely calling the required Java VM:
Perhaps JAVA_HOME should also be explicitely set before starting the application:
I used the following instruction by downloading the jdk binaries directly from Oracle. The instructions apply for jdk6 also.
Oracle now owns Sun, and has renamed it to Oracle Java. If you want to install the latest version of Java 6, you can download it here:
The binary file is a self-extracting archive. Copy it to where you want to install it, e.g.
Then create a link,
Do the same for
Run this command in a terminal (Ctrl+Alt+T):
It worked fine for me.
Hi check out this very detailed explanation of how to install java jdk on your pc and test it http://www.pavanh.com/2013/03/installing-java-jdk.html
Open the terminal and execute below commands one by one. It will install JDk as well as JRE. No need to configure anything. It will take care of everything.
JDK 6 along with JRE
OR FOR JDK 7
Once executed you can check, whether the Java and JDK is installed by