LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-20-2004, 11:35 AM   #1
ranger225
LQ Newbie
 
Registered: Aug 2004
Posts: 29

Rep: Reputation: 15
Question symbolic link problem in mandrae


hi,
i have mandrake 10 installed on my machine.....
i installed j2sdk.bin self extracting file with the superuser access. it extracted j2sdk folder in /root . n then i made a symbolic link in /usr/bin folder. first i went into the directory /usr/bin n there i typed:

ln -s /root/j2sdk/bin/java java

after tht i again came to the /root folder n typed java...it executed properly........

but when i exited from superuser shell n typed java it gives error message command not found.......therefore every time i have to have superuser access to run java command. I made the same link in /usr/local/bin also but same error....plz suggest me a solution so tht a normal user can also run this command.......

Last edited by ranger225; 09-20-2004 at 03:00 PM.
 
Old 09-20-2004, 11:40 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
You're better off putting the java package in somewhere else such as /opt and add it to your PATH in /etc/profile or ~/.bash_profile etc
Code:
export PATH=$PATH:/opt/j2sdk/bin
 
Old 09-20-2004, 02:57 PM   #3
ranger225
LQ Newbie
 
Registered: Aug 2004
Posts: 29

Original Poster
Rep: Reputation: 15
hey....tried tht too.....but it didn't work.....
 
Old 09-20-2004, 03:02 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Re: symbolic link problem in mandrae

Quote:
Originally posted by ranger225
ln -s /root/j2sdk/bin/java java
Why on earth did you install it in roots home?


Cheers,
Tink
 
Old 09-20-2004, 03:13 PM   #5
ranger225
LQ Newbie
 
Registered: Aug 2004
Posts: 29

Original Poster
Rep: Reputation: 15
is there any other way to do it?
 
Old 09-20-2004, 03:21 PM   #6
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
I think one problem could have been not qualifying the path when doing the link. Instead of

ln -s /root/j2sdk/bin/java java

maybe try

ln -s /root/j2sdk/bin/java ./java

or

ln -s /root/j2sdk/bin/java /usr/bin/java


Also, you can use the ls command to verify where the newly created /usr/bin/java link actually points. Do an ls -a java in the /usr/bin directory to see where it points. Finally, make sure /usr/bin is actually defined in your path using

cat PATH

Perhaps when you type "java", the shell is refering to some other file named java.

Also you could try to type "/usr/bin/java" when testing your invocation so at least you are sure of which file named "java" you are invoking just incase there is another one on the system that happens to fall in your PATH.
 
Old 09-20-2004, 03:21 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
is there any other way to do it?
Sure ... Demonbane seems to have it in /opt
Mine lives under /usr ...


Cheers,
Tink
 
Old 09-20-2004, 04:45 PM   #8
Tim2000
LQ Newbie
 
Registered: Oct 2003
Location: Québec
Distribution: Slackware 9.1
Posts: 12

Rep: Reputation: 0
Try changing the permissions on the symbolic link with chmod.
chmod 777 filename
 
Old 09-20-2004, 07:49 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally posted by Tim2000
Try changing the permissions on the symbolic link with chmod.
chmod 777 filename
It's IMPOSSIBLE to change the perms on
a symlink... it will always be lrwxrwxrwx.


Cheers,
Tink
 
Old 09-21-2004, 03:07 AM   #10
ranger225
LQ Newbie
 
Registered: Aug 2004
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by jdruin

Also, you can use the ls command to verify where the newly created /usr/bin/java link actually points. Do an ls -a java in the /usr/bin directory to see where it points. Finally, make sure /usr/bin is actually defined in your path using
doing ls -a in /usr/bin gives java@ o/p. it does not show where this link points
 
Old 09-21-2004, 04:05 AM   #11
chii-chan
Member
 
Registered: Sep 2003
Location: chikyuu (E103N6)
Distribution: Redhat 8.0 (2.4.25-custom), Fedora Core 1 (2.4.30-custom)
Posts: 357

Rep: Reputation: 30
There is no way you can enter /root as user. Try cd /root. You can't. Put the program somewhere else, for example in /usr/local/.

So,

ln -s /usr/local/j2sdk/bin/java /usr/bin/java

should be okay.
 
Old 09-21-2004, 08:19 AM   #12
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
Sorry. ls -l will resolve links. Its show the ---> symbol after the link name then shows the link target. I thought ls -a would show link targets since it shows all files but I guess not.
 
Old 09-21-2004, 01:03 PM   #13
ranger225
LQ Newbie
 
Registered: Aug 2004
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by chii-chan
There is no way you can enter /root as user. Try cd /root. You can't. Put the program somewhere else, for example in /usr/local/.

So,

ln -s /usr/local/j2sdk/bin/java /usr/bin/java

should be okay.
thanx chi......but i tried tht too.......i created a link in /usr/local also.....but it didn't help...neways thanx
 
Old 09-21-2004, 03:47 PM   #14
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally posted by ranger225
doing ls -a in /usr/bin gives java@ o/p. it does not show where this link points
ls -lL
will give you the dereferenced file ...


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Symbolic link? jasone Linux - Newbie 4 05-06-2005 08:55 AM
Java (JRE 1.5.0_02) - Symbolic Link Problem pacranch Amigo 1 04-14-2005 06:37 AM
symbolic link jsetter Linux - Newbie 4 11-22-2004 08:18 AM
Redhat 8.0 Symbolic Link Problem & Maillog Problem. borisys Red Hat 1 07-27-2004 10:35 AM
Symbolic link. bulzbb Linux - General 8 03-19-2004 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration