Since 11.10 Ubuntu does not provide the
sun-java-jdk, how do I install it?
migrated from stackoverflow.com Nov 4 '11 at 16:01
Ubuntu 11.10 Oneric
Ubuntu 12.04 Precise
Clean up the historical open jdk:
Add a new repo and install the sdk:
If you want the JRE and the browser plugin:
Ubuntu 12.04 (Precise Pangolin) - another way
Thanks to the comments, please note that you can try this method too: http://www.liberiangeek.net/2012/04/install-oracle-java-jdk-7-in-ubuntu-12-04-precise-pangolin/
Make the sun java the default
You may want to also add the following
You should get the following
Selection Path Priority Status
0 /usr/lib/jvm/java-7-oracle/bin/java 1 auto mode 1 /usr/lib/jvm/java-7-oracle/bin/java 1 manual mode * 2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1 manual mode
Press enter to keep the current choice[*], or type selection number: 2
Select (2) and press enter
java version "1.7.0_04" Java(TM) SE Runtime Environment (build 1.7.0_04-b20) Java HotSpot(TM) Server VM (build 23.0-b21, mixed mode)
|show 9 more comments|
Build local debs:
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 ;)
You can install the official package from Oracle :
choose linux as your platform
I'd suggest to go with openjdk if possible (for any average user that is). The only thing you might need from sun/oracle is browser plugin, but that could be installed without installing the jre (just unpack).
I resolved this by becoming root, exporting the http/https proxies and then repeating the above line without sudo.
protected by Community♦ Mar 6 '12 at 23:15
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.