jar dependencies

Shannon -jj Behrens jj at nttmcl.com
Wed Mar 26 16:50:56 PST 2003


I apologize that this email isn't a direct response to the earlier email about
jar dependencies.  I have a habit of deleting things too quickly ;)

The problem is that the author of the previous email has 27 copies and 15
flavors of Ant on his system, but none of us really has time to convince the
whole Java world to be more cooperative about dependencies.  Naturally, the
RIGHT THING would be to have each jar dependency placed in its own port, and
each Java port would depend on a set of jar ports.  Versioning would be a pain
(imagine 15 flavors of the Ant port), but things would sit nicely with hier,
and it would feel like FreeBSD.

At the risk of being flamed to death, I propose the following novel approach.
Everything Java should be installed in /usr/java.  Each Java port should 
simply be wholly copied to /usr/java/$port_name.  Then, for each dependency
jar found in /usr/java/$port_name (via find), the following logic would take
place: if that jar is already present in /usr/java/lib, hardlink to that file
in /usr/java/lib.  Otherwise, move that jar to /usr/java/lib and then hardlink
to that file.  When removing a Java port, simply delete the 
/usr/java/$port_name directory.  Optionally, clean up the /usr/java/lib
directory by deleting any files who have a refcount of 1 (i.e. jar files
that are used by any Java port).  I've noticed that the jar files don't seem
to have any version information.  Hence, the above procedure will need to be
complicated to take this into mind.  I.e., when copying the jar to 
/usr/java/lib, copy it to /usr/java/lib/$jar_name-$arbitrary_version.  When 
trying to find if a given jar file is already present in /usr/java/lib, compare
that jar file (using diff) to each jar file in /usr/java/lib/$jar_name-*.
Naturally, all of the above maintenance of /usr/java/lib could be wrapped up
in a simple program (probably just a shell script) that would be invoked by the
port.

I realize that this is quite a break from the standard way FreeBSD does things.
In fact, I'd be surprised if anyone took me seriously.  However, I would like
to point out that since Java is practically an OS unto itself, it's not 
totally unreasonable that it must be treated in a special manner.

Best Regards,
-jj

-- 
Hacker is to software engineer as 
Climbing Mt. Everest is to building a Denny's there.


More information about the freebsd-java mailing list