Wednesday, February 24, 2010

How to set JAVA_HOME in Ubuntu

12 comments:

  1. to install sun java6 just type

    sudo apt-get install sun-java6-jdk

    in the terminal

    ReplyDelete
  2. for Ubunhu 10.04

    sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
    sudo apt-get update

    then install...

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

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

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

    source /etc/bash.bashrc

    to reload the changes.

    ReplyDelete
  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-1.6.0.22

    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
    Malaysia
    f.van.der.star@gmail.com

    ReplyDelete
  6. @Frans van der Star

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

    type,

    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

    regards

    ReplyDelete
  7. Dear Suho Thayan,

    Thanks.

    I got the result you mentioned.

    http://www.opentaps.org/forum/opentaps-general-discussions/general-discussions-english/step-step-instructions-ubuntu
    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-1.6.0.22
    Or does not matter???
    Till now thanks a lot!!

    Greetings
    Frans

    If you want to stay in touch feel free emailing me

    f.van.der.star@gmail.com!!

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

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

    Any sun or openjdk latest version would do

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

    ReplyDelete
  9. Thanks

    It is all working now.

    use java-6-sun-1.6.0.22

    Kind regards

    Frans

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

    ReplyDelete
  11. thanks for the post

    ReplyDelete
  12. 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.

    ReplyDelete