[74c1100] | 1 | <sect2>
|
---|
[06aea651] | 2 | <title>Configuring <application>J2SDK</application></title>
|
---|
[74c1100] | 3 |
|
---|
| 4 | <sect3><title>Configuration Information</title>
|
---|
| 5 |
|
---|
[06aea651] | 6 | <para>We have two Java 2 <acronym>SDK</acronym>'s installed in
|
---|
[8a0cee4] | 7 | <filename>/opt/j2sdk</filename>. Decide on which one you
|
---|
[1bf950c] | 8 | would like to use as the default. For example if you decide to use the source
|
---|
[06aea651] | 9 | compiled <application>J2SDK</application>, do the following:</para>
|
---|
[1bf950c] | 10 |
|
---|
[06aea651] | 11 | <screen><userinput><command>ln -nsf j2sdk-&j2sdk-src-version; /opt/j2sdk/j2sdk</command></userinput></screen>
|
---|
[1bf950c] | 12 |
|
---|
[8a0cee4] | 13 | <para>Add the following lines to your shell startup file (e.g.
|
---|
[06aea651] | 14 | <filename>/etc/profile</filename>).</para>
|
---|
[74c1100] | 15 |
|
---|
[06aea651] | 16 | <screen><userinput>export JAVA_HOME=/opt/j2sdk/j2sdk
|
---|
| 17 | export PATH=$PATH:$JAVA_HOME/bin</userinput></screen>
|
---|
[74c1100] | 18 |
|
---|
[52b9837f] | 19 | <para>Add <filename>$JAVA_HOME/man</filename> to your
|
---|
| 20 | <envar>MANPATH</envar> variable or to
|
---|
[8a0cee4] | 21 | <filename>/etc/man.conf</filename></para>
|
---|
[1bf950c] | 22 |
|
---|
[06aea651] | 23 | <para>The <application>Java</application> plugin is in the directory
|
---|
| 24 | <filename class="directory">$JAVA_HOME/jre/plugin/i?86/ns610/</filename>.
|
---|
[1bf950c] | 25 | Make a symbolic link to the file in that directory from your plugins directory.
|
---|
| 26 | </para>
|
---|
| 27 |
|
---|
[74c1100] | 28 | </sect3>
|
---|
[1bf950c] | 29 |
|
---|
[9255931] | 30 | <sect3><title>Handling CLASSPATH</title>
|
---|
| 31 |
|
---|
| 32 | <para>When compiling packages, the <envar>CLASSPATH</envar> environment variable
|
---|
[50143e0] | 33 | is used by JDK to locate classes at compile-time and run-time. It is tedious to
|
---|
[9255931] | 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 |
|
---|
[74c1100] | 53 | </sect2>
|
---|