Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: How to install the JDK on Ubuntu Linux

  1. #1
    Join Date
    Jul 2010
    Washington, USA
    Thanked 43 Times in 39 Posts

    Default How to install the JDK on Ubuntu Linux

    Hello everyone! I recently made the change from Windows to Linux. I've really enjoyed it so far, and everything worked out of the box except getting the JDK. I had a bit of trouble getting it to work, so I'll post what I did for everyone else.

    Step one: Open the Terminal
    Go to Applications>Accessories>Terminal

    Step two: Find out the current version of the JDK
    sudo apt-cache search jdk

    Step three: Install the JRE and JDK using apt-get

    sudo apt-get install sun-java6-jdk sun-java6-jre

    Step four: Confirmation
    Ubuntu is going to start the download and ask you if you want to continue. Press "y" and hit enter.

    Post installation: Append files
    Set JAVA_HOME into environment variable

    Copy following statement and append to /etc/profile or .bashrc file, make system set JAVA_HOME into system environment variable.
    export JAVA_HOME="/usr/lib/jvm/java-6-sun-;"

    Ported from: How to install java jdk on ubuntu (linux)
    Last edited by Brt93yoda; November 22nd, 2010 at 11:18 AM.

  2. The Following User Says Thank You to Brt93yoda For This Useful Post:

    JavaPF (November 26th, 2010)

  3. #2
    Join Date
    May 2011
    Thanked 0 Times in 0 Posts

    Default Re: How to install the JDK on Ubuntu Linux

    what about openjdk?

  4. #3
    Junior Member
    Join Date
    Jul 2011
    Philadelphiaj Pa
    Thanked 0 Times in 0 Posts

    Default Re: How to install the JDK on Ubuntu Linux

    I think the difference is only license
    java - Why should I use the Sun JDK over the OpenJDK, or vice-versa? - Stack Overflow

Similar Threads

  1. How to install a JDBC driver in Eclipse? And where to take it from?
    By noFear in forum Java Theory & Questions
    Replies: 2
    Last Post: August 17th, 2010, 10:51 AM
  2. Help running SQL queries in Ubuntu
    By Mic[RSA] in forum Java IDEs
    Replies: 0
    Last Post: June 29th, 2010, 12:53 PM
  3. Help Executing C Program From Java! (Ubuntu)
    By penguinGirl in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 18th, 2010, 01:47 PM
  4. Maven Issues - mvn install
    By Paolo Futre in forum Java Theory & Questions
    Replies: 5
    Last Post: August 26th, 2009, 05:07 AM
  5. Installation of JDK on linux Mandrive or Ubuntu
    By kut@all in forum Java Theory & Questions
    Replies: 1
    Last Post: May 21st, 2009, 02:06 PM

Tags for this Thread