Find the answer to your Linux question:
Results 1 to 9 of 9
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Explaination needed to add java to path


    Can someone explain to me how to add Java to the path?

    I have tried several things, including re-installing Java. Mozilla recognizes it, and when I go to the Java website it verifies that I am using the latest jre1.6.0_01. it is located at:

    usr/java/jre1.6.0_01

    Aparently the syslink works, but limewire will not install (java dependencies).

    The first time i Installed Mandriva 2007 free on a computer it worked without a hitch.

    Trying to install it on a second computer has really been a bear. I have read, searched, experimented, etc. to no avail.

    How do I know if Java is in my path?
    If not, How do I put it there?
    I have tried following the instructions posted on this forum, but nothing seems to work.

    Still loving the Mandriva 2007, if I can get over this one hump... I will be thumbing my nose at Mr. Gates.

    Thanks for the help!

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,874
    You can copy the script below and place in /etc/profile.d (you need to be root), name it something like java.sh and make it executable
    Code:
    chmod a+x /etc/profile.d/java.sh).
    export JAVA_HOME=/usr/java/jre1.6.0_01
    export PATH=$PATH:/usr/java/jre1.6.0_01/bin export
    MANPATH=$MANPATH:/usr/java/jre1.6.0_01/man
    When you next logout and back in again, java will be in your path.
    Hope this helps
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3

    Explaination needed to add java to path

    Ok.... I understand that part.

    I have an existing java.sh file in the location mentioned, but.....

    How do I edit it?

    That is the question. Do I use a text editor? Tried that but wouldn't let me access the file, said I didn't have the right permissions.

  4. $spacer_open
    $spacer_close
  5. #4

    Explaination needed to add java to path

    This is what is in My java.sh file now.

    I noticed that the 3rd line is different. which is correct?

    export JAVA_HOME=/usr/java/jre1.6.0_01
    export PATH=$PATH:/usr/java/jre1.6.0_01/bin
    export MANPATH=$MANPATH:/usr/java/jre1.6.0_01/man

  6. #5
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,776
    you can gain root privileges with 'su' command.
    Code:
    su
    cp <path_of_java.sh> /etc/profile.d
    EDIT: contents of java.sh file is correct.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #6

    Explaination needed to add java to path

    This is the results I get:

    [root@localhost profile.d]# ls
    10lang.csh* glib20.csh* mc.sh* qtdir3.sh*
    10lang.sh* glib20.sh* menustyle.csh* screen.sh*
    10mandriva-release.csh* inputrc.csh* menustyle.sh* ssh-client.sh*
    10mandriva-release.sh* inputrc.sh* msec.csh* tmpdir.csh*
    alias.csh* java.sh* msec.sh* tmpdir.sh*
    alias.sh* kde3.sh* numlock.sh* xhost.csh*
    configure_keyboard.sh* less.csh* python.csh* xhost.sh*
    gconf.csh* less.sh* python.sh*
    gconf.sh* mc.csh* qtdir3.csh*
    [root@localhost profile.d]# cp /etc/profile.d/java.sh> /etc/profile.d
    bash: /etc/profile.d: Is a directory
    [root@localhost profile.d]#

  8. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,776
    cp /etc/profile.d/java.sh> /etc/profile.d
    where did you save java.sh file?
    you have to copy java.sh file to /etc/profile.d folder.
    i assume that java.sh file is on Desktop. execute this
    Code:
    su
    cp ~/Desktop/java.sh /etc/profile.d
    type correct path of java.sh file.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #8
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,874
    Quote Originally Posted by mlaymance View Post
    This is the results I get:

    [root@localhost profile.d]#cp /etc/profile.d/java.sh> /etc/profile.d
    bash: /etc/profile.d: Is a directory
    [root@localhost profile.d]#
    cp /etc/profile.d/java.sh> /etc/profile.d/ don't forget the last slash /
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  10. #9

    Explaination needed to add java to path

    Ok guys,
    Thanks for all the help.. got it figured out.... then downloaded frostwire (It's better than Limewire!!!!!)

    works like a charm..... Life is good!!!

    Thanks for the help

    Michael

Posting Permissions

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