What are jar, rmiregistry, and who knows what else doing in /usr/bin ?
I know that everyone just shoves /usr/local/java/sdk/bin (or whatever) in at the top of $PATH, but I can think of several very good reasons that is not a good idea. So if there's a good reason, I'd like some feedback before I post a bug on this.
-- Joel Rees rees@ddcom.co.jp digitcom, inc. 株式会社デジコム Kobe, Japan +81-78-672-8800 ** http://www.ddcom.co.jp **
On Fri, 18 Feb 2005 18:52:58 +0900, Joel rees@ddcom.co.jp wrote:
What are jar, rmiregistry, and who knows what else doing in /usr/bin ?
they are java related packages. they might have been installed by default. if you dont want remove them. this is not a bug
Joel wrote:
What are jar, rmiregistry, and who knows what else doing in /usr/bin ?
$ ls -l /usr/bin/rmiregistry /usr/bin/jar lrwxrwxrwx 1 root root 21 Feb 15 20:37 /usr/bin/jar -> /etc/alternatives/jar lrwxrwxrwx 1 root root 29 Feb 15 20:37 /usr/bin/rmiregistry -> /etc/alternatives/rmiregistry
They're symlinks into the Red Hat alternatives scheme. man 8 alternatives says:
It is possible for several programs fulfilling the same or similar functions to be installed on a single system at the same time. For example, many systems have several text editors installed at once. This gives choice to the users of a system, allowing each to use a different editor, if desired, but makes it difficult for a program to make a good choice of editor to invoke if the user has not specified a particular preference.
The alternatives system aims to solve this problem. A generic name in the filesystem is shared by all files providing interchangeable func- tionality. The alternatives system and the system administrator together determine which actual file is referenced by this generic name. For example, if the text editors ed(1) and nvi(1) are both installed on the system, the alternatives system will cause the generic name /usr/bin/editor to refer to /usr/bin/nvi by default. The system administrator can override this and cause it to refer to /usr/bin/ed instead, and the alternatives system will not alter this setting until explicitly requested to do so.
So they allow you to have a number of Java virtual machines, and easily swap from one to another.
James.
On Fri, 18 Feb 2005, Rahul Sundaram wrote:
On Fri, 18 Feb 2005 18:52:58 +0900, Joel rees@ddcom.co.jp wrote:
What are jar, rmiregistry, and who knows what else doing in /usr/bin ?
they are java related packages. they might have been installed by default. if you dont want remove them. this is not a bug
$ ls -l /usr/bin/jar lrwxrwxrwx 1 root root 21 Feb 11 11:35 /usr/bin/jar -> /etc/alternatives/jar
The Jpackage-style Java installs (including the gcj one included in FC3) use the alternatives(8) system to manage simultaneous installation of multiple versions.
(Apologies for the cross-post.)
I asked
What are jar, rmiregistry, and who knows what else doing in /usr/bin ?
I know that everyone just shoves /usr/local/java/sdk/bin (or whatever) in at the top of $PATH, but I can think of several very good reasons that is not a good idea. So if there's a good reason, I'd like some feedback before I post a bug on this.
Rahul explained
they are java related packages. they might have been installed by default. if you dont want remove them. this is not a bug
and James added
They're symlinks into the Red Hat alternatives scheme. man 8 alternatives says:
[...]So they allow you to have a number of Java virtual machines, and easily swap from one to another.
and then Matthew clarified
The Jpackage-style Java installs (including the gcj one included in FC3) use the alternatives(8) system to manage simultaneous installation of multiple versions.
Okay, I'll dig into the alternatives man page, although I really didn't want to know about that. Don't plan on using it.
But I did not install any java at all when I installed Fedora. There was no javac in the same place. Moreover, on this FC2 install, these are not symbolic links. If they're multiply linked, the links are hard. They do not show up in /etc/alternatives, nor in anything in /var/lib/alternatives.
Why are jar and rmic in there at all? Are they being used by the system, and if I remove them will something break? How do I find out what else to remove?
I really would prefer not to put the directory where I've installed sun's java at the top of my path, but it looks like I have to put it there if I want to compile sun-standard java 5 rmi.
-- Joel Rees rees@ddcom.co.jp digitcom, inc. 株式会社デジコム Kobe, Japan +81-78-672-8800 ** http://www.ddcom.co.jp **
Joel wrote:
(Apologies for the cross-post.)
I asked
What are jar, rmiregistry, and who knows what else doing in /usr/bin ?
I know that everyone just shoves /usr/local/java/sdk/bin (or whatever) in at the top of $PATH, but I can think of several very good reasons that is not a good idea. So if there's a good reason, I'd like some feedback before I post a bug on this.
Rahul explained
they are java related packages. they might have been installed by default. if you dont want remove them. this is not a bug
and James added
They're symlinks into the Red Hat alternatives scheme. man 8 alternatives says:
[...]So they allow you to have a number of Java virtual machines, and easily swap from one to another.
and then Matthew clarified
The Jpackage-style Java installs (including the gcj one included in FC3) use the alternatives(8) system to manage simultaneous installation of multiple versions.
Okay, I'll dig into the alternatives man page, although I really didn't want to know about that. Don't plan on using it.
But I did not install any java at all when I installed Fedora. There was no javac in the same place. Moreover, on this FC2 install, these are not symbolic links. If they're multiply linked, the links are hard. They do not show up in /etc/alternatives, nor in anything in /var/lib/alternatives.
Why are jar and rmic in there at all? Are they being used by the system, and if I remove them will something break? How do I find out what else to remove?
rpm is your friend! You can use it to figure out what package they're in:
matt@tomis ~ $ rpm -q -f /usr/bin/jar libgcj-3.3.3-7
and then test removing it to see what other packages depend on it:
matt@tomis /etc/alternatives $ /bin/su Password: root@tomis /etc/alternatives $ rpm -e --test libgcj error: Failed dependencies: libgcj.so.4 is needed by (installed) gettext-0.14.1-2.1 libgcj = 3.3.3 is needed by (installed) libgcj-devel-3.3.3-7 libgcj >= 3.3.3 is needed by (installed) gcc-java-3.3.3-7
In this case, if I didn't want GNU's java compiler, I could remove gcc-java and libgcj-devel, but there might be some other programs that use gettext:
root@tomis /etc/alternatives $ rpm -e --test gettext error: Failed dependencies: gettext is needed by (installed) mutt-1.4.1-6
You'll need to remove the --test option to actually remove the packages, if you want to do that.
root@tomis /etc/alternatives $ man rpm