1 | <sect2>
|
---|
2 | <title>Configuring <application>J2SDK</application></title>
|
---|
3 |
|
---|
4 | <sect3><title>Configuration Information</title>
|
---|
5 |
|
---|
6 | <para>We have two Java 2 <acronym>SDK</acronym>'s installed in
|
---|
7 | <filename>/opt/j2sdk</filename>. Decide on which one you
|
---|
8 | would like to use as the default. For example if you decide to use the source
|
---|
9 | compiled <application>J2SDK</application>, do the following:</para>
|
---|
10 |
|
---|
11 | <screen><userinput><command>ln -nsf j2sdk-&j2sdk-src-version; /opt/j2sdk/j2sdk</command></userinput></screen>
|
---|
12 |
|
---|
13 | <para>Add the following lines to your shell startup file (e.g.
|
---|
14 | <filename>/etc/profile</filename>).</para>
|
---|
15 |
|
---|
16 | <screen><userinput>export JAVA_HOME=/opt/j2sdk/j2sdk
|
---|
17 | export PATH=$PATH:$JAVA_HOME/bin</userinput></screen>
|
---|
18 |
|
---|
19 | <para>Add <filename>$JAVA_HOME/man</filename> to your
|
---|
20 | <envar>MANPATH</envar> variable or to
|
---|
21 | <filename>/etc/man.conf</filename></para>
|
---|
22 |
|
---|
23 | <para>The <application>Java</application> plugin is in the directory
|
---|
24 | <filename class="directory">$JAVA_HOME/jre/plugin/i?86/ns610/</filename>.
|
---|
25 | Make a symbolic link to the file in that directory from your plugins directory.
|
---|
26 | </para>
|
---|
27 |
|
---|
28 | </sect3>
|
---|
29 |
|
---|
30 | <sect3><title>Handling CLASSPATH</title>
|
---|
31 |
|
---|
32 | <para>When compiling packages, the <envar>CLASSPATH</envar> environment variable
|
---|
33 | is used by JDK to locate classes at compile-time and run-time. It is tedious to
|
---|
34 | add all the classes used to the <envar>CLASSPATH</envar> manually. You may add
|
---|
35 | the following lines to your shell startup file to set <envar>CLASSPATH</envar>
|
---|
36 | automatically to include all JAR files in a specified directory, which in
|
---|
37 | the example below is <filename>/usr/lib/auto-java-classpath</filename>.</para>
|
---|
38 |
|
---|
39 | <screen><userinput>AUTO_CLASSPATH_DIR=/usr/lib/auto-java-classpath
|
---|
40 | if [ -z $CLASSPATH ]
|
---|
41 | then
|
---|
42 | CLASSPATH=.:$AUTO_CLASSPATH_DIR
|
---|
43 | else
|
---|
44 | CLASSPATH=$CLASSPATH:.:$AUTO_CLASSPATH_DIR
|
---|
45 | fi
|
---|
46 | for i in $(ls $AUTO_CLASSPATH_DIR/*.jar 2>/dev/null)
|
---|
47 | do
|
---|
48 | CLASSPATH=$CLASSPATH:$i
|
---|
49 | done</userinput></screen>
|
---|
50 |
|
---|
51 | </sect3>
|
---|
52 |
|
---|
53 | </sect2>
|
---|