Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Need Help on JAVA_HOME, CLASSPATH set up

  1. #1
    Join Date
    Jul 2006
    Beans
    29
    Distro
    Ubuntu 13.04 Raring Ringtail

    Need Help on JAVA_HOME, CLASSPATH set up

    I need step-by-step instructions on how to set up the JAVA_HOME and CLASSPATH variables. Can anyone help me out with this issue?

    Thanks in advance.

  2. #2
    Join Date
    Apr 2006
    Beans
    10

    Re: Need Help on JAVA_HOME, CLASSPATH set up

    it depends on what implementation of java you have installed, where it is installed, and a number of other things.

    If you already know what you want to set JAVA_HOME and CLASSPATH to, you can just run
    Code:
    sudo gedit /etc/environment
    and then add a line for each variable.

  3. #3
    Join Date
    Jul 2006
    Beans
    29
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Need Help on JAVA_HOME, CLASSPATH set up

    Thanks tedwardo2, it worked perfectly fine.

    See you around.

  4. #4
    Join Date
    Jul 2006
    Beans
    29
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Need Help on JAVA_HOME, CLASSPATH set up

    This is the output of the "etc/environment" file after I "gedit" it,

    Code:
    PATH="/usr/local/Java/jdk1.5.0_07/bin:.:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
    LANG="en_AU.UTF-8"
    LANGUAGE="en_AU:en"
    JAVA_HOME="/usr/local/Java/jdk1.5.0_07"
    CLASSPATH="/usr/local/Java/jdk1.5.0_07/lib:."
    It may serve you as a guide to you folks looking for help.
    Last edited by DapperDrakeNewbieDR; October 22nd, 2006 at 10:43 PM.

  5. #5
    Join Date
    Jul 2007
    Beans
    6

    Re: Need Help on JAVA_HOME, CLASSPATH set up

    i'm having the same problem, but i don't know exactly what to do. i installed jdk and jre trough apt-get but i can't find "/usr/local/Java/jdk1.5.0_07/bin:." or any of the others path you used.
    The best i was able to do was to find the java folder in usr/share but i can't find anything like jdk1.5.0_07/bin:. in it. This is the content of the java folder :



    wich path should i use? doi need to install somtging else? atm the content of my etc/environment is:

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    LANG="it_IT.UTF-8

    thx in advice for help

    P.S. sry for may bad english

  6. #6
    Join Date
    Jun 2005
    Beans
    2,314

    Re: Need Help on JAVA_HOME, CLASSPATH set up

    The easiest way to find it is to use the command
    whcih java
    which probably says /usr/bin/java, but this is a symlink. if you do
    ls -l /usr/bin/java
    it will tell you where it links to (probably another symlink). Keep on followinf the symlinks until you find the real executable. It's there somewhere.

    If you install java straight from Sun, it defaults into /opt/java..., but the Ubuntu packagers tend to put java in /usr/lib or /usr/share or something like that.

    P.S.
    With the Sun JRE, you don't normally need to set JAVA_HOME or CLASSPATH at all.

  7. #7
    Join Date
    May 2008
    Beans
    1

    Smile Re: Need Help on JAVA_HOME, CLASSPATH set up

    If you have installed java through sudo apt-get install ......
    then it is installed in /usr/lib/jvm

  8. #8
    Join Date
    Jul 2007
    Location
    Brussels
    Beans
    29
    Distro
    Ubuntu Gnome

    Re: Need Help on JAVA_HOME, CLASSPATH set up

    euhm.. is my case:

    which java
    /usr/bin/java

    ls -l /usr/bin/java
    /usr/bin/java -> /etc/alternatives/java

    ls -l /etc/alternatives/java
    /etc/alternatives/java -> /usr/lib/jvm/java-gcj/jre/bin/java

    Changed that to:
    java -> /usr/lib/jvm/java-6-sun-1.6.0.06/jre/bin/java


    then I added the following line to /etv/environment:
    JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.06/"

    and created the following symlink:
    /usr/java/jdk -> /usr/lib/jvm/java-6-sun-1.6.0.06/

    although I have both... java is sooooo confusing!!
    Last edited by bwakkie; June 30th, 2008 at 02:54 PM.
    HW: Intel Core 2 CPU T7400 @ 1.66GHz, Dell Latitude D620, Intel Mobile 945GM/PM/GMS 943/940GML Express IGP + ICH7-M, 2014MB, 160GB, 1280x800 -- OS: Gentoo 2004-2010 & Ubuntu 7.4-10.10

  9. #9
    Join Date
    Apr 2007
    Location
    Moscow, Russia
    Beans
    57
    Distro
    Kubuntu 14.04 Trusty Tahr

    Wink Re: Need Help on JAVA_HOME, CLASSPATH set up

    Quote Originally Posted by bwakkie View Post
    Changed that to:
    java -> /usr/lib/jvm/java-6-sun-1.6.0.06/jre/bin/java

    and created the following symlink:
    /usr/java/jdk -> /usr/lib/jvm/java-6-sun-1.6.0.06/
    You really shouldn't. Just run this command:
    Code:
    sudo update-java-alternatives -s java-6-sun
    It will set java-6-sun to be run by default.

  10. #10
    Join Date
    Apr 2005
    Location
    Valby, Denmark
    Beans
    134
    Distro
    Ubuntu 9.10 Karmic Koala

    Red face Re: Need Help on JAVA_HOME, CLASSPATH set up

    Quote Originally Posted by elnur View Post
    You really shouldn't. Just run this command:
    Code:
    sudo update-java-alternatives -s java-6-sun
    It will set java-6-sun to be run by default.
    Why does java on linux have to be so obscure?

    I was wondering why my netbank didn't work anymore - but when I ran java --version gcj had stolen my settings from sun being default...

    Even after running that command to set java alternatives firefox hangs and uses up 100% cpu time when trying to access my netbank

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •