Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
I'm trying to get my Java installation to find alle the java commands without me cd into the java dirctory. Is there a way.. I think there is a file ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! feddersen's Avatar
    Join Date
    Dec 2004
    Location
    Norway
    Posts
    82

    Path variable file


    I'm trying to get my Java installation to find alle the java commands without me
    cd into the java dirctory. Is there a way.. I think there is a file that control this? Oh! If there is I need to know where it is.. exactly.. the file search just keep crashing..

  2. #2
    Linux Newbie
    Join Date
    Apr 2005
    Location
    South America
    Posts
    152
    Hi, all you have to do is this:

    PATH=$PATH:[java installation path]

    in your .bashrc or .bash_profile

    cheers

  3. #3
    Just Joined! feddersen's Avatar
    Join Date
    Dec 2004
    Location
    Norway
    Posts
    82
    Thanks
    you probably have an idee on where that file is located (mandrake)?

  4. #4
    Linux Newbie
    Join Date
    Apr 2005
    Location
    South America
    Posts
    152
    mmm dunno for sure, maybe try
    /usr/java/jdk1.5.0_01/bin/

    It really depends on where you have it installed, for example, some people install it at /opt rather than /usr

  5. #5
    Just Joined!
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    18
    hey, that's a rather special nick you got there, darklordsatan.

  6. #6
    Linux Newbie
    Join Date
    Apr 2005
    Location
    South America
    Posts
    152
    Quote Originally Posted by hansjoakim
    hey, that's a rather special nick you got there, darklordsatan.
    hehe, yes I do sir

  7. #7
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by feddersen
    Thanks
    you probably have an idee on where that file is located (mandrake)?
    Code:
    find / -iname 'javac' | grep bin
    should find the javac executable for you, and will show u where it's located.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  8. #8
    Linux Newbie
    Join Date
    Apr 2005
    Location
    South America
    Posts
    152
    This is an even easier (and faster) way:

    $ whereis -b javac

  9. #9
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,790
    Quote Originally Posted by darklordsatan
    This is an even easier (and faster) way:

    $ whereis -b javac
    So there is.... but i assume that requires u to have done a updatedb first. the same as slocate.

    And not just an updatedb, but do that AFTER installing java.
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

  10. #10
    Linux Newbie
    Join Date
    Apr 2005
    Location
    South America
    Posts
    152
    Quote Originally Posted by sdousley
    Quote Originally Posted by darklordsatan
    This is an even easier (and faster) way:

    $ whereis -b javac
    So there is.... but i assume that requires u to have done a updatedb first. the same as slocate.

    And not just an updatedb, but do that AFTER installing java.
    Dunno for sure (yeah, my root skills suck). AFAIK, updatedb is used with locate, but whereis just searches into common paths or something like that
    Obviously, although faster, you cant deny the power of find, might be slower, but more robust

Page 1 of 2 1 2 LastLast

Posting Permissions

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