A More FHS-Compliant JDK Install

Per Bothner per.bothner at oracle.com
Mon Jan 3 08:26:34 UTC 2011

On 01/02/2011 06:28 PM, David Herron wrote:
> yes..but..
> Setting JAVA_HOME and export PATH=${JAVA_HOME}/bin:${PATH} is an excess
> step to installing software implemented in Java that is not normally
> required for other software.
> On a Linux system, to run a Python program (for example), are you
> required to do the equivalent?  Or can you just type "python script.py"?
> It's the latter...
> Why isn't it the same/similar for Java?

It is, at least on Fedora, where java and javac are in
/usr/bin.  But /usr/bin/java is a symlink to /etc/alternatives/java,
which is a symlink to /usr/lib/jvm/jre-1.6.0-openjdk/bin/java.

Of course I'm talking about the Fedora-supported openjdk packages;
not the Oracle downloads.

> Why do we make our customers perform extraneous steps?  That they might
> not understand.  That they might get wrong.  Where they might not read
> the README.  Which make it harder to do automated software installs.
> ..etc..

/usr/bin is normally reserved for programs managed by the system
package manager - i.e. distributed as .rpm or .deb files from a
package repository.  Packages not distributed as .rpms or .debs
are usually installed in /opt or /usr/local.  Packages compiled
from source can be installed anywhere; the GNU default if not
overridden is /usr/local.

> BTW Several years ago Sun unilaterally decided that, on Linux, the
> various JDK's should be installed in /usr/java.  The design allowed for
> multiple JDK's inside /usr/java.  At the time I thought that was an okay
> idea.  But after having talked with people in several Linux distro
> projects, I understand the value of weaving Java into the system so that
> it feels as seamless as e.g. Python does.

There is no /usr/java on Fedora 14, at least.
	--Per Bothner
per.bothner at oracle.com   per at bothner.com   http://per.bothner.com/

More information about the build-dev mailing list