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
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
“For Uninstallation”
sudo apt-get remove oracle-java7-installer
How exactly it works?
Purging openjdk is a bad idea, it’ll remove anything that depends on it too. Better to install the oracle jdk and then use ‘alternatives’ to select it as the new default.
https://help.ubuntu.com/community/Java#Choosing_the_default_Java_to_use
Very useful. Thank you
ohh thank you,its long time i were trying to install but gives me alot of an error,but this its useful
Thanks for the nfo!
Worked first time!
Thanks.
I wish Canonical could employ you!
Worked first time for me!! Many thanks…
wrong: sudo apt-get purge openjdk*
correct: sudo apt-get purge ‘openjdk*’
a glob expansion could occur.
wrong: sudo apt-get purge openjdk*
correct: sudo apt-get purge ‘^openjdk.*’
a purge(search, remove) option take a regular expression not a glob expression.
Thank you, I am using ubuntu 12ubuntu 12.-0.-0 your steps worked for like charm.
The minimal ubuntu server install does not include add-apt-repository. You can install it with the following prior to running the other commands.
sudo apt-get install software-properties-common
Just wanted to say thanks. I’ve referred to this article more times than I can remember. Muchas gracias!
Awesome! I´ve searched a long time for that solution. Now it works. I am happy. God bless you my friend! 😀
Works like charm….Thanks!
LOOK UP “CGA SAYS” ON THIS PAGE AND FOLLOW THEIR VERY SIMPLE INSTRUCTIONS! YOU’RE WELCOME.
Had problem with my Java 7 in Ubuntu 12.10. Followed these instruction to the letter, worked perfectly. Thank you!
@cga :- U rock bro!! it works just fine
You are a god among men.
Just tried to install a Tekkit (Minecraft) server on my Linux box – thought it might be the Java 6 install of OpenJDK I had installed. Using your guide allowed me to get rid of that and get Oracle’s 7 installed in no time at all – and the Tekkit server is working nicely. Great job!
Just great! the only answer, i’ve finally found to this problem…opensource java does not work…thanks
This worked but I would recommend using the Ubuntu Software Center rather than purging file and applications.
Thanks a lot for the post. It worked for me!.
Thank you very much, I love you bro!!!!! lmao
Thank you so much !!! may the force be with you !
Great, this tutorial is very good because was helped me a lot.
thanks for the help 🙂 works on BT like this also
USC uses just the same commands.
Fantastic, thanks! Works on Ubuntu 11 also.
Thank you man. Works on Ubuntu 13.04!
Fun watching the terminal get the job done.. when java8 comes out do you just change the linecommand from 7 to 8?
Man, I love you 😀 I’ve been trying to install java with the instructions on ubuntu wiki, with official instructions on java.com, but nothing helped… This did!
I don’t know who you are, I don’t know where you are, but I will find you and I will thank you 🙂
(btw Ubuntu 13.04 here, works like a charm)