Help - Search - Members - Calendar
Full Version: Where To Change Which?
Linuxhelp > Support > Technical Support
paulcon
Somewhere on my computer is some kind of map that tells the system which executable to run when I call a particular command. I can discover which particular executable it will run by typing something like

'which java'

This command may return '/usr/bin/java'. SO...my question is, where do i configure this? How can I tell my system that when I call 'java' I want to use something else, like '/opt/jdk1.5.2/bin/java'?

Thanks,
Paul
Termina
QUOTE
PATH=$PATH:/path/to/bin/java
export PATH


For your current session, type those lines.

To have this work for everyone, add that to the end of /etc/.bash_profile (or your .bash_profile in /home/username)

In /etc/profile you can add /path/to/bin/java at the end of PATH (should be near the top)
DS2K3
Basically, any executable4s inside a directory listedn in $PATH can be accessed just by typing it's name rather than the full path.

So, you could juist creat a symlink in /bin that points to /usr/java/.... or, create a shell script that launches it.

D
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.