Gentoo Archives: gentoo-announce

From: Karl Trygve Kalleberg <karltk@×××××××.no>
To: gentoo-announce@g.o
Subject: [gentoo-announce] New Java scheme
Date: Thu, 24 Jan 2002 10:12:16
At long last, the new Java scheme is in place. It features:

* support for multiple JREs and JDKs (tested with Sun and Blackdown, IBM
coming)* unified handling of JARballs
* a java-config script

There are still some remaining issues that I work on:
* PHP 4.0.6 and 4.1.1's configure scripts seem to be flawed wrt Java
support* The tomcat ebuilds do not work at all
* a Jikes use-flag, and Jikes support in most (all ?) Java ebuilds

To benefit from the new scheme, you will sadly have to remerge all your
Java stuff. For most people, it will only mean merging:

You also have the option of using 
instead of blackdown-jdk-1.3.1

Please bear with me if an error two crops up. The changes are somewhat
substantial, and I point to Gentoo's pre-1.0 status as an excuse (and
blame Canada for the rest).


Q: What was wrong with /opt/java, why the new scheme ?

A:<All binary-only/commercial JREs and JDKs are installed in /opt. All
Free JREs and JDKs (japhar, sablevm, kaffe, kissme, ...) are installed in
/usr. This is in accordance with our interpretation of the FHS.

Also, the different JREs and JDKs have different directory-layouts.
Consequently, the simple /opt/java symlink trick that we used proves

Q: What do I use instead of /opt/java, then ?

The env vars JAVA_HOME, PATH, ROOTPATH and CLASSPATH are set correctly in
env.d, so you can assume that jar, java, javac, etc are in the path if you
depend on a JDK. If you depend on a JRE, only java and its runtime library
will be available.

Q: What about java libraries ?

All libraries should be installed in /usr/share/{$PN}. This is done for
you by the dojar command. If your package depends on other java libraries
to build, use java-config to build a CLASSPATH, e.g. java-config
--full-classpath=jaxp,ant will set up the CLASSPATH to contain the runtime
library for you current JDK or JRE, as well as the necessary jar files for
jaxp and ant.

Q: What about java programs ?

You might have to tweak your program's shellscript (or even make one from
scratch) so that the necessary jar-files are included in its CLASSPATH.
Look in ant's files dir for a (complex) example.

Q: Any last remarks ?

Yes. If you need to know anything about the java environment, _ALWAYS_ use
java-config. Exception is the env var JAVA_HOME, which you can usually use
with the --with-java configure option: --with-java=${JAVA_HOME}