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
[Source] Ubuntu 12.04 PreciseClean up the historical open jdk:
Add a new repo and install the sdk:
If you want the JRE and the browser plugin:
[Source] Ubuntu 12.04 (Precise Pangolin) - another wayThanks 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 defaultYou may want to also add the following
You should get the following Selection Path Priority Status0 /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 Now running:
Returns: 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) |
|||||||||||||||||||
|
|
There is very good page on official Ubuntu wiki. There you can find all recommended methods. I've used this excellent automatic script. 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 : http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html 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). |
|||
|
|
|
Upon attempting
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.