Install Sun (Oracle) Java on Ubuntu without using PPAs

Install JDK on Ubuntu manually without depending on PPAs –

  1. Select the required package from here – Download the jdk-[version].bin file from the downloads page.
  2. Make the downloaded file runnable; Eg – sudo chmod +x jdk-6u32-linux-x64.bin
  3. Run this file; Eg- sudo ./jdk-6u32-linux-x64.bin
  4. Move the newly created folder to /usr/lib/jvm/. Eg – sudo mv jdk1.6.0_32 /usr/lib/jvm/ (Optionally change the user of this folder to yourselves)
  5. Add the newly added jdk to known java command option –
    sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_32/bin/java" 1
    sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_32/bin/javac" 1
    sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_32/bin/javaws" 1
  6. Choose the new java, javac and javaws by running commands-
    sudo update-alternatives --config java
    sudo update-alternatives --config javac
    sudo update-alternatives --config javaws


Run java -version to verify installation. Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *


* Copy This Password *

* Type Or Paste Password Here *

68,509 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>