Saturday, April 14, 2012

How to install Java / OpenJDK in Ubuntu

About how to install Java / OpenJDK in different versions and releases of Ubuntu (>= 10.04.4).

To install R, JGR and Deducer in Ubuntu you will need Java - a technology from Oracle (formerly: Sun Microsystems). There are several implementations, of which the free OpenJDK Development Kit (JDK) is the easiest to install and the default version of Java that Ubuntu uses.
  • Installation of OpenJDK
For Ubuntu 10.04.4, 10.10 and 11.04 (32/64-bit) on the official repositories only the 6th version of OpenJDK is available. To install it just run in terminal (with root privileges):
apt-get install -y openjdk-6-jdk

If you have installed other versions of Java, set OpenJDK as default:
update-java-alternatives -s java-6-openjdk

If R is already installed, enable Java support:
R CMD javareconf

For Ubuntu 11.10 and 12.04 (32/64-bit) on the official repositories are available both 6th and 7th versions of OpenJDK. To install one of them just run in terminal (with root privileges):
apt-get install -y openjdk-6-jdk
apt-get install -y openjdk-7-jdk

If you have installed also other versions of Java, set OpenJDK as default -
for the 6th version, 32/64-bit:
update-java-alternatives -s java-1.6.0-openjdk
for the 7th version, 32-bit:
update-java-alternatives -s java-1.7.0-openjdk-i386
for the 7th version, 64-bit:
update-java-alternatives -s java-1.7.0-openjdk-amd64

To solve received errors, please, read the post Solving OpenJDK install errors in Ubuntu.


  1. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training JavaEE Training in Chennai Java EE Training in Chennai

  2. Excellent post !!!Everyone are repeating the same concept in their blog, but here I get a chance to know new things . I will also suggest your content to my friends.
    java training center in chennai
    java institutes in chennai

  3. The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
    Digital Marketing online training

    full stack developer training in pune

    full stack developer training in annanagar

  4. I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.
    python training in OMR
    python training in Bangalore
    python training in rajajinagar
    Python training in btm
    Python training in usa

  5. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you article.
    Blueprism training in Pune

    Blueprism online training

    Blue Prism Training in Pune

  6. From your discussion I have understood that which will be better for me and which is easy to use. Really, I have liked your brilliant discussion. I will comThis is great helping material for every one visitor. You have done a great responsible person. i want to say thanks owner of this blog.

    Data science training in tambaram | Data Science training in anna nagar
    Data Science training in chennai | Data science training in Bangalore
    Data Science training in marathahalli | Data Science training in btm

  7. I would like to thank you for your nicely written post, its informative and your writing style encouraged me to read it till end. Thanks
    java training in chennai

    java training in marathahalli | java training in btm layout

  8. This comment has been removed by the author.


  9. Well done! Pleasant post! This truly helps me to discover the solutions for my inquiry. Trusting, that you will keep posting articles having heaps of valuable data. You're the best! 
    angularjs Training in chennai
    angularjs Training in chennai

    angularjs-Training in tambaram

    angularjs-Training in sholinganallur

    angularjs-Training in velachery

  10. Greetings. I know this is somewhat off-topic, but I was wondering if you knew where I could get a captcha plugin for my comment form? I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.

    AWS Interview Questions And Answers

    AWS Tutorial |Learn Amazon Web Services Tutorials |AWS Tutorial For Beginners

    AWS Online Training | Online AWS Certification Course - Gangboard

    AWS Training in Toronto| Amazon Web Services Training in Toronto, Canada

  11. I love the information you provide here and can’t wait to take a look when I get home.
    nebosh course in chennai

  12. Amazing Article ! I have bookmarked this article page as i received good information from this. All the best for the upcoming articles. I will be waiting for your new articles. Thank You ! Kindly Visit Us @ Coimbatore Travels | Ooty Travels | Coimbatore Airport Taxi | Coimbatore taxi

  13. Great work. Quite a useful post, I learned some new points here.I wish you luck as you continue to follow that passion.

    Automation Training in Chennai
    Automation Training