1 |
At long last, the new Java scheme is in place. It features: |
2 |
|
3 |
* support for multiple JREs and JDKs (tested with Sun and Blackdown, IBM |
4 |
coming)* unified handling of JARballs |
5 |
* a java-config script |
6 |
|
7 |
There are still some remaining issues that I work on: |
8 |
* PHP 4.0.6 and 4.1.1's configure scripts seem to be flawed wrt Java |
9 |
support* The tomcat ebuilds do not work at all |
10 |
* a Jikes use-flag, and Jikes support in most (all ?) Java ebuilds |
11 |
|
12 |
To benefit from the new scheme, you will sadly have to remerge all your |
13 |
Java stuff. For most people, it will only mean merging: |
14 |
dev-java/blackdown-{jre|jdk}-1.3.1-r<latest> |
15 |
|
16 |
You also have the option of using |
17 |
dev-java/sun-jdk-1.3.1 |
18 |
instead of blackdown-jdk-1.3.1 |
19 |
|
20 |
Please bear with me if an error two crops up. The changes are somewhat |
21 |
substantial, and I point to Gentoo's pre-1.0 status as an excuse (and |
22 |
blame Canada for the rest). |
23 |
|
24 |
DEVELOPER NOTES |
25 |
|
26 |
Q: What was wrong with /opt/java, why the new scheme ? |
27 |
|
28 |
A:<All binary-only/commercial JREs and JDKs are installed in /opt. All |
29 |
Free JREs and JDKs (japhar, sablevm, kaffe, kissme, ...) are installed in |
30 |
/usr. This is in accordance with our interpretation of the FHS. |
31 |
|
32 |
Also, the different JREs and JDKs have different directory-layouts. |
33 |
Consequently, the simple /opt/java symlink trick that we used proves |
34 |
insufficient. |
35 |
|
36 |
Q: What do I use instead of /opt/java, then ? |
37 |
|
38 |
The env vars JAVA_HOME, PATH, ROOTPATH and CLASSPATH are set correctly in |
39 |
env.d, so you can assume that jar, java, javac, etc are in the path if you |
40 |
depend on a JDK. If you depend on a JRE, only java and its runtime library |
41 |
will be available. |
42 |
|
43 |
Q: What about java libraries ? |
44 |
|
45 |
All libraries should be installed in /usr/share/{$PN}. This is done for |
46 |
you by the dojar command. If your package depends on other java libraries |
47 |
to build, use java-config to build a CLASSPATH, e.g. java-config |
48 |
--full-classpath=jaxp,ant will set up the CLASSPATH to contain the runtime |
49 |
library for you current JDK or JRE, as well as the necessary jar files for |
50 |
jaxp and ant. |
51 |
|
52 |
Q: What about java programs ? |
53 |
|
54 |
You might have to tweak your program's shellscript (or even make one from |
55 |
scratch) so that the necessary jar-files are included in its CLASSPATH. |
56 |
Look in ant's files dir for a (complex) example. |
57 |
|
58 |
Q: Any last remarks ? |
59 |
|
60 |
Yes. If you need to know anything about the java environment, _ALWAYS_ use |
61 |
java-config. Exception is the env var JAVA_HOME, which you can usually use |
62 |
with the --with-java configure option: --with-java=${JAVA_HOME} |