Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

Thread: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way

  1. #1
    Join Date
    Dec 2004
    Location
    Germany
    Beans
    155
    Distro
    Ubuntu 12.04 Precise Pangolin

    Post 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:

    1. 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".
    2. In Software Centre, search for "sun java" and install the first package ("Sun Java 6.0 Plugin"). You are done!




    I also created a short video tutorial with these instructions which you can watch by clicking on this image:




    = Appendix =

    == 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.
    == 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.
    == 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
    == 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
    Last edited by zerwas; October 16th, 2010 at 09:18 PM. Reason: Edited "expert way" to work with future and past Ubuntu releases

  2. #2
    Join Date
    Jun 2010
    Location
    In A Big Pepsi Bottle
    Beans
    211
    Distro
    Ubuntu 10.10 Maverick Meerkat

    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.

  3. #3
    Join Date
    Dec 2004
    Location
    Germany
    Beans
    155
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way

    Quote Originally Posted by soldier1st View Post
    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.

    are there any advantages of using sun java instead of OpenJDK?
    Azureus for example works faster with Sun Java than with OpenJDK.

    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.

  4. #4
    Join Date
    Aug 2008
    Location
    New Zealand
    Beans
    53
    Distro
    Ubuntu 10.04 Lucid Lynx

    Talking Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way

    Thanks so much Zerwas this worked a treat, am much obliged

  5. #5
    Join Date
    Aug 2006
    Beans
    278

    Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way

    Quote Originally Posted by soldier1st View Post
    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).

  6. #6
    Join Date
    Jun 2010
    Location
    Thawville, IL
    Beans
    19
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way

    This is greatly appreciated zerwas..

    Thank you so very much

  7. #7
    Join Date
    Dec 2006
    Beans
    9

    Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way

    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


    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?

  8. #8
    Join Date
    Dec 2004
    Location
    Germany
    Beans
    155
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way

    Quote Originally Posted by bogaczew View Post
    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.

    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:

    For Firefox-specific help, see the Mozilla Knowledgebase.
    Last edited by zerwas; July 7th, 2010 at 10:50 PM.

  9. #9
    Join Date
    Dec 2006
    Beans
    9

    Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way

    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.

    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
    Last edited by bogaczew; July 9th, 2010 at 03:11 PM. Reason: https://bugzilla.mozilla.org/show_bug.cgi?id=577670

  10. #10
    Join Date
    Dec 2004
    Location
    Germany
    Beans
    155
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Install Sun Java in Ubuntu 10.04 - the easiest way

    Quote Originally Posted by bogaczew View Post
    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.
    Last edited by zerwas; July 8th, 2010 at 03:19 PM.

Page 1 of 4 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •