How to install Java on Linux Ubuntu – Tutorial. (11 posts)

Topic tags: install, linux, OpenJDK, ppa, ubuntu
  • Profile picture of mifth mifth132p said 1 year ago:

    Important Note: See updated information below.

    This is a tutorial for beginners. Just open console and run following commands:

    Java 6 installation:

    sudo add-apt-repository ppa:ferramroberto/java
    sudo apt-get update
    ---OR---
    sudo add-apt-repository ppa:sun-java-community-team/sun-java6
    sudo apt-get update
    ---
    sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk sun-java6-fonts

    Use Java 6 as default:

    sudo update-alternatives --config java

    Select: /usr/lib/jvm/java-6-sun/jre/bin/java

    Firefox Java plugin installation:

    –64bit–

    cd /usr/lib/mozilla/plugins
    sudo ln -s /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so
    ---
    

    –32bit–

    cd /usr/lib/mozilla/plugins
    sudo ln -s /usr/lib/jvm/java-6-sun/jre/lib/i386/libnpjp2.so
    ---
    

    Have a nice day.

  • Profile picture of thetoucher thetoucher349p said 1 year ago:

    great! wish this was around a few weeks ago when I sunk a few hours into trying to get it up and running =)

  • Profile picture of mifth mifth132p said 1 year ago:

    No problem! :) If someone knows how to install Java 6 to Fedora it would be cool to post here too.

  • Profile picture of mbaucco mbaucco1p said 1 year ago:

    none of these commands work for me:

    sudo update-java-alternatives -s java-6-sun
    sudo update-alternatives –config java
    Select: /usr/lib/jvm/java-6-sun/jre/bin/java
    sudo update-alternatives –install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib64/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so 50

    Basically they say there are no alternatives and that -config and -install are unknown arguments. When I try to run jMonkey it locks up.

    Thanks,
    Matt

  • Profile picture of mifth mifth132p said 1 year ago:

    html works incorrrectly. Thanks for your answer. I updated my topic. Have a try again, please.

  • Profile picture of mbaucco mbaucco1p said 1 year ago:

    ok, got all of them but the last one, I am wondering if it is due to the AMD64 in the path?

    Thanks again!
    Matt

  • Profile picture of Momoko_Fan Momoko_Fan366p said 1 year ago:

    amd64 is only for 64 bit OS. If you have a 32 bit OS you must use a different command for that one.

  • Profile picture of mifth mifth132p said 1 year ago:

    Thanks! I added 32bit and 64bit versions for firefox plugin.

  • Profile picture of mbaucco mbaucco1p said 1 year ago:

    hmm, now I am getting this error:
    “update-alternatives: –install needs link> name> path> priority>” (I removed the “<" so they would show up)
    Thanks again for all the help! :)

  • Profile picture of cheshirekow cheshirekow1p said 4 months, 1 week ago:

    Evidently the PPA linked to in this thread is an older version which has not fixed certain security vulnerabilities. Oracle has released a newer version but you wont find it in the repositories (evidently licensing issues). You can get it from the oracle website. I found these instructions to be useful: http://www.webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html

  • Profile picture of Empire Phoenix Empire Phoenix156p said 4 months, 1 week ago:

    Also note while this sets ajva to the oracle jvm javaws is still using openjdk (or whatever stuff was installed)
    This can lead to some confusion if you are not aware of it.