Install Oracle Java 7 in Ubuntu via PPA Repository

10:45 PM

We've previously written about installing Oracle JDK 7 in Ubuntu using a script with a GUI provided by Zenity. Some may find this method hard to use and also, it comes with GTK dependencies. So as an alternative that doesn't have any GTK dependencies and comes with automatic updates too, I've set up an Ubuntu PPA for the latest Oracle Java 7 (JDK).

If you really need to use Oracle (ex Sun) Java instead of OpenJDK in Ubuntu, here's an easy way to do it: a PPA repository to install and keep your computer up to date with the latest Oracle Java 7 (JDK).

Oracle JDK7 itself is not hosted in the PPA because that's not allowed by the new Java license (which is also the reason why it has been removed from the official Ubuntu repositories); the package in the PPA automatically downloads (and installs) Oracle Java JDK 7 from its official website and installs it on your computer, just like the flashplugin-installer package does.


Please note that this package is currently in alpha and is offered without any guarantees, so it may or may not work! Use it at your own risk! The package should support proxies just like the flashplugin-installer does, but it may fail if your ISP or router blocks some non-standard ports because Oracle uses quite a few redirects for the Java 7 binary download links. If the download fails because of blocked ports or because you're behind a firewall, use the manual Oracle Java 7 installation method (link in the beginning of the post).


Install Oracle Java 7 in Ubuntu via PPA


This package provides Oracle Java JDK 7 (which includes Java JDK, JRE and the Java browser plugin). However, you can't only install Oracle JRE - the PPA only provides the full Oracle JDK7 package.


To add our PPA and install the latest Oracle Java 7 in Ubuntu (supports Ubuntu 12.04, 11.10, 11.04 and 10.04), use the commands below:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer


Removing Oracle Java 7


If you don't want to use Oracle Java (JDK) 7 anymore and want to go back to OpenJDK, all you have to do is remove the Oracle JDK7 Installer and the previous Java (OpenJDK, etc.) version will be used:
sudo apt-get remove oracle-java7-installer


The package is based on Bruce Ingalls' Java Update script and on the flashplugin-installer debian package - thanks!

0 comments:

Post a Comment