Help - Search - Members - Calendar
Full Version: Where To Change Which?
Linuxhelp > Support > Technical Support
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'. 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'?

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)
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.

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-2018 Invision Power Services, Inc.