How to install oracle java 7 in ubuntu 13.04/12.10/12.04
Java is a programming language and computing platform first released by Sun Microsystems in 1995. It is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.
Preparing your system
First you need to remove openjdk for this run the following command from your terminal
sudo apt-get purge openjdk*
If you installed java 7 from any other PPA and you are having problem with java then you have to do following steps before installing the PPA menctioned here
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
Install oracle java 7 in ubuntu 13.04/12.10/12.04
Open the terminal and run the following commands
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
You can check the java version by searching java in dashboard
nice nice nice!! Many thanks! Last time I tried installing oracle java it was a real pain in the *ss. Worked like a charm, very clean!!! <3
Thank you guys! The oracle java has been installed successfully even i had troubles with my own applications. But in result i have got the real $JAVA_HOME which points to real JAVA. Ubuntu is great now with such improvement. Serious app can be installed now in moment.
How to install Java 64-bit?
Thank you very much. This is only guide that works.
Been looking for a straight forward install for ubuntu, and this was exacly that, and the most simple.
Thanks alot mate!
This process apparently installs the 32-bit version of Java. Any instructions on how to install the 64-bit version? (because the 32-bit version won’t run on 64-bit Ubuntu 13.04). Thanks
Works fine up until the point:
“sudo apt-get install oracle-java7-installer”
Just get the error message
E: Unable to locate package oracle-java7-installer
Did I mess something up?
Same here. What is the problem that is causing this?
Just download the netbeans and jdk bundle from Oracle. It will install everything for you..
Seems to work in 13.10 Saucy Salamander as well, just installed it on the final beta.
The only problem with this approach since 2013 is that Java release a massive 100Mb+ update every few weeks via an incredibly slow repo at http://download.java.net/
It can take up to 20 minutes to down the 100Mb using a 120Mbps connection. It often times out and you have to start again.
I don’t know why Java have changed their working practices – probably weak security, but so many big and slow updates is unprofessional.
Good stuff. installed java7 in a flash
It 100% works thanks
thanks, this is so simple compared to some of the other instructions out there. worked on 4 machines. thanks again!
Thanks it worked.
Very useful. Worked as expected without any hiccups at all.
Thanks a lot for sharing.
hangs at okay…. …. …. ….ect for a long time is this normal?
getting this error…new to ubuntu please guide
Proxy request sent, awaiting response… 403 Forbidden file type or location
2014-03-07 18:48:46 ERROR 403: Forbidden file type or location.
Oracle JDK 7 is NOT installed.
dpkg: error processing oracle-java7-installer (–configure):
subprocess installed post-installation script returned error exit status 1
Setting up gsfonts-x11 (0.22) …
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
Have you installed Java 7 from the Ubuntu Software Center?
Thanks you for this helpful instruction
works greate thanks.
“sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer”
What am I doing in the fist two steps above. The last one is obvious.
In the first command you are adding a repository to apt, where you can find the installer. The second command updates the cache of apt, after which it can find the oracle-java7-installer.