0

For example, the following command install java to /usr/bin/java

update-alternatives --install /usr/bin/java java /opt/java7/bin/java 1 && update-alternatives --set java /opt/java7/bin/java

What if I also want to set java under /bin/java at the same time?

Ryan
  • 5,831
  • 24
  • 72
  • 91
  • And what would be the reason to do this? You can install a `java` at `/bin` and call it with `/bin/java`. – Sven Aug 22 '13 at 10:50

1 Answers1

0

You must create new alternative under different name, but you shouldn't do that unless you know what are you doing, I just don't see the reason:

PATH variable by default will contain both /bin/ and /usr/bin/. Modern systems even have symlinks for /bin/ and /sbin/, targeting /usr/bin/ and /usr/sbin/ respectively, same with /lib/ and /lib64/.

GioMac
  • 4,544
  • 4
  • 27
  • 41