Thursday, February 25, 2010

How to set JAVA_HOME in Ubuntu


  1. to install sun java6 just type

    sudo apt-get install sun-java6-jdk

    in the terminal

  2. for Ubunhu 10.04

    sudo add-apt-repository "deb lucid partner"
    sudo apt-get update

    then install...

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

  3. Actually you dont need a restart... you can simply do a source to reload the changes.

  4. @Rajat Thanks,
    so you have to just type

    source /etc/bash.bashrc

    to reload the changes.

  5. Hi Suho Thayan

    I try to get Ant working in Ubuntu 10.04.

    I need this because I want to try to install Opentaps; kind of ERP for lean manufacturing

    As I followed your instructions. Not succeeded, Build XML does not exist.

    I also tried all the files in /usr/lib/jvm:
    - java-1.5.0-gcj-4.4
    - java-1.6.0-openjdk In this one tools.jar was expected to be inside
    - java-6-openjdk
    - java-6-sun
    - java-6-sun-

    I really hope you can help me out of this.

    Ant appears to be quite complex sometimes.

    Await your feedback with interest.

    Kind regards.

    Frans van der Star

  6. @Frans van der Star

    Its nothing to do with Java, since it says Build XML not exist, ant should have got installed properly


    ant -version

    in your terminal. If it prints something like this,
    "Apache Ant version 1.7.1 compiled on September 8 2010"

    your done with the ant installation
    else run,
    sudo apt-get install ant
    to install ant

    when running ant you should run the command "ant" from the directory where it contains the file build.xml
    I think you can find one in the Opentaps directories


  7. Dear Suho Thayan,


    I got the result you mentioned.
    These are instructions for install opentaps.

    Now I see!!

    I had to do cd the directory opentaps
    Then type ant.
    Now I get the result:
    Build successfull
    1 minute 54 seconds.

    Only one question remains;
    java home: Which one I should use:
    - java-1.5.0-gcj-4.4
    - java-1.6.0-openjdk In this one tools.jar was expected to be inside
    - java-6-openjdk
    - java-6-sun
    - java-6-sun-
    Or does not matter???
    Till now thanks a lot!!


    If you want to stay in touch feel free emailing me!!

    P.S.: Do you have expertise and knowledge ERP-systems?

  8. great :)
    Use either
    - java-6-sun-
    - java-1.6.0-openjdk

    Any sun or openjdk latest version would do

    Sorry, I don't have experience in ERP-systems :(

  9. Thanks

    It is all working now.

    use java-6-sun-

    Kind regards


  10. Thank you!! JAVA_HOME was successfully set!!

  11. Good post. I have also shared about How to Set JAVA_HOME in Windows and Unix , this article also talks about difference between JAVA_HOME and java.home variable.