JRE file layout for 1.0.7?

Jim Pick jim at kaffe.org
Sat Mar 30 11:48:42 PST 2002

> Jim Pick writes:
> > I want to minimize the number of changes for 1.0.7, in order to minimize
> > amount of surprises and I don't want to introduce new instabilities.
> >
> > But I would like to change the way the the files are installed when
> > "make install".  Instead of installing it by default in /usr/local/bin,
> > /usr/local/lib, /usr/local/include, etc., I'd like to have the default
> > install put everything in /usr/local/kaffe, in a JRE-style layout.  That
> > way, people could just set JAVA_HOME to point there, and use it instead
of a
> > regular JDK or JRE.  Plus I've always disliked how the kaffe install
> > those "java" and "javac" wrappers in /usr/local/bin.  Also, I've been
bit a
> > few times by kaffe versions I've been working on accidentally
> > loading the kaffe.org libs installed in /usr/local/lib instead of the
libs I
> > intended.
> I don't know which is better or worse, but this is contrary to the
> way FreeBSD ports work. Everything goes into /usr/local/bin, etc.
> in a standard layout. Otherwise you'd have to add a zillion things
> to your PATH.

It's contrary to the FSSTND/FHS used by Linux distributions too.  They'd
expect the files to be installed in /usr/bin, /usr/lib, /usr/share, etc.

On the other hand, the JRE layout is the standard set by Sun.

Remember, what I'm proposing to change is just the default install location
for people compiling from the source tarball.  The distribution people can
always rearrange the files to suit a system-wide layout policy.  In the
FSSTND/FHS standard, the /usr/local heirarchy is set aside for the system
administrator to place locally installed packages compiled from source (eg.

> On the other hand, /usr/local/kaffe is a good way to keep things
> separate... Hmm..

Speaking as a guy who has to juggle dozens of Java versions, my preference
is to keep things separate.

> Can you explain in a little more detail how JAVA_HOME works? What
> happens when I type "java" on the command line and both kaffe and
> some other JRE are installed? Etc.

If you type "java" on your command line, you'll get whichever one is in your
path.  eg.  If I want to use kaffe, I just make sure /usr/local/kaffe/bin is
added to the front of my PATH variable.  If I want to use Sun's JRE, I might
set my path to /usr/local/jre1.2.2/bin.  Of course, someone could always
install it under /usr/local instead of /usr/local/kaffe if they wanted it
added to their system path.

A lot of scripts and programs look to see if $JAVA_HOME has been defined,
and if so, they try to use $JAVA_HOME/bin/java as their interpreter.

> I guess my only objection is that it would be nice if people shouldn't
> have to add /usr/local/kaffe/bin (or whatever) to their PATH in
> order to run kaffe after installing it...

My biggest objection with the current situation is that if somebody already
has a version of Java they use installed in one of their system directories,
and then they install kaffe, they might overwrite an existing installation,
or programs on their system might accidentally use kaffe instead of another
existing JVM installed under /usr/bin, for example.  Imagine a system
administrator trying to install kaffe to run a particular application on a
production server that already is running servlets with a system-supplied
JVM - if the system administrator wasn't careful, and didn't change the
defaults, then he or she is pretty much guaranteed to mess things up on
their system.  Granted, a system administrator should know better, but I'm a
big believer in the principle of least surprise.  :-)


 - Jim

More information about the kaffe mailing list