HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
Preface: There can be many reasons why you need Java on your system. You need Java in case you want to use Wuala, the secure peer-to-peer online storage, or Freenet, an anonymous and censor-resistant network. Or maybe you need just want to play a little browser game which requires Java.
There are several Java implementations, but the default Java implementation in Ubuntu does not always work with other software, that is why i created this specific tutorial for Sun's version of Java.
= How to install Sun Java in Ubuntu 10.04 =
First, we need to enable Canonical's so-called "partner" repository which includes popular non-free software like Skype, Google Earth or Sun Java. Afterwards we can install all those applications just like you are used to with every other application:
- Enable repository: Click Applications -> Software Centre -> In the Menubar, choose Edit -> Software Sources. Go to tab Other Software and tick the first entry ("partner"). Close and confirm the "Reload".
- In Software Centre, search for "sun java" and install the first package ("Sun Java 6.0 Plugin"). You are done!
Quote:
== Check installation ==
There are several ways to check if Sun Java is installed correctly, fire up your browser (like Firefox, Chrome, Chromium, Opera, Epiphany, ...), now:
- type into the address bar:
about:plugins
You should see an entry for Sun Java on this page. - You can visit the Java test page at java.com.
- To verify your installed Java software, see Verify Installation at java.com.
- Java Tester includes links to verify your Java version and whether Java is enabled.
For Firefox-specific help, see the
Mozilla Knowledgebase.
Quote:
== Problems ==
If you face any problems, see if other Java implementations are installed. To check this, remove those packages:
- icedtea6-plugin
- openjdk-6-jre-lib
For Firefox-specific problems related with Java you can also consult the
Mozilla Knowledgebase.
Quote:
== Multiple Java installations ==
If you have a parallel OpenJDK Java installed and want to keep it but would like to set Sun Java to be the default, execute this command:
Code:
sudo update-alternatives --set java /usr/lib/jvm/java-6-sun/jre/bin/java
=== Manually choose Java version ===
It is also possible to manually choose which Java version you want to let the system use:
Code:
sudo update-alternatives --config java
To specify the Java version
for your browser plugin manually, execute
Code:
sudo update-alternatives --config mozilla-javaplugin.so
Quote:
== The expert way ==
If you are a command line freak, you might like this method instead:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ubuntu $(lsb_release -s -c) partner"
sudo apt-get update && sudo apt-get install sun-java6-plugin
Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
why would you want sun java when you get OpenJDK?are there any advantages of using sun java instead of OpenJDK?i have java apps and they work fine with OpenJDK.
Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
Quote:
Originally Posted by
soldier1st
why would you want sun java when you get OpenJDK?
Thanks for your question, soldier1st. First, there are several applications that have problems with OpenJDK (or the other way round) like Freenet, Wuala, Sparnord and others but work fine with Sun JRE. A Google search reveals many applications and issues. Also see Launchpad for issues with OpenJDK, if you are interested. So if you want to use one of these applications you have to use Sun Java.
Quote:
are there any advantages of using sun java instead of OpenJDK?
Azureus for example works faster with Sun Java than with OpenJDK.
Quote:
i have java apps and they work fine with OpenJDK.
Then there is no need to switch over to Sun Java of course. Open source should always be the first choice if it fits all your needs.
Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
Thanks so much Zerwas this worked a treat, am much obliged:D
Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
Quote:
Originally Posted by
soldier1st
why would you want sun java when you get OpenJDK?are there any advantages of using sun java instead of OpenJDK?i have java apps and they work fine with OpenJDK.
One popular problem is the icedtea-plugin which is dependend on firefox libraries and only works on this browser (atleast in 10.04, hope they fix this mess in the next version).
Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
This is greatly appreciated zerwas..
Thank you so very much :D
Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
Quote:
if you have a parallel OpenJDK Java installed and want to keep it but would like to set Sun Java to be the default, execute this command:
Code:
sudo update-alternatives --set java /usr/lib/jvm/java-6-sun/jre/bin/java
why not simple
Code:
sudo update-alternative --config java
Quote:
If you face any problems, see if other Java implementations are installed. To check this, remove those packages:
* icedtea6-plugin
* openjdk-6-jre
it's a clear bug to me. there should be two plugins available in firefox, and one should choose which one he wants to use. i just don't know where should i report it. mozilla? ubuntu? oracle?
Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
Quote:
Originally Posted by
bogaczew
why not simple
Code:
sudo update-alternative --config java
Because with your command you have to choose on your own, which Java implementation you want to enable as default. There is less that can go wrong if you just copy and paste my command into the terminal.
Quote:
It's a clear bug to me. there should be two plugins available in firefox, and one should choose which one he wants to use.
That's already possible through the Add-ons window in Firefox (you need to disable the other java plugin). See my posting:
Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
Quote:
Because with your command you have to choose on your own, which Java implementation you want to enable as default. There is less that can go wrong if you just copy and paste my command into the terminal.
OK. I see Your point.
Quote:
That's already possible through the Add-ons window in Firefox (you need to disable the other java plugin).
in my ubuntu 10.06 64b, with firefox from repo, there is only one java plugin in add-ons window. either icedtea or sun-javaplugin. you have to uninstall icedtea to use sun-java plugin.
so i will report it to mozilla.
https://bugzilla.mozilla.org/show_bug.cgi?id=577670
Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way
Quote:
Originally Posted by
bogaczew
in my ubuntu 10.06 64b, with firefox from repo, there is only one java plugin in add-ons window. either icedtea or sun-javaplugin. you have to uninstall icedtea to use sun-java plugin.
You are right. But while Firefox changed to OpenJDK after installing icedtea plugin and didn't change back even when i did update-alternatives, Chromium always used Sun Java.
It would be nice if you could give us the URL to your bug report. :)