mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-02-06 00:48:19 +08:00
92559316ef
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@1718 af4574ff-66df-0310-9fd7-8a98e5e911e0
55 lines
1.9 KiB
XML
55 lines
1.9 KiB
XML
<sect2>
|
|
<title>Configuring <application>J2SDK</application></title>
|
|
|
|
<sect3><title>Configuration Information</title>
|
|
|
|
<para>We have two Java 2 <acronym>SDK</acronym>'s installed in
|
|
<filename>/opt/j2sdk</filename>. Decide on which one you
|
|
would like to use as the default. For example if you decide to use the source
|
|
compiled <application>J2SDK</application>, do the following:</para>
|
|
|
|
<screen><userinput><command>ln -nsf j2sdk-&j2sdk-src-version; /opt/j2sdk/j2sdk</command></userinput></screen>
|
|
|
|
<para>Add the following lines to your shell startup file (e.g.
|
|
<filename>/etc/profile</filename>).</para>
|
|
|
|
<screen><userinput>export JAVA_HOME=/opt/j2sdk/j2sdk
|
|
export PATH=$PATH:$JAVA_HOME/bin</userinput></screen>
|
|
|
|
<para>Add <filename>$JAVA_HOME/man</filename> to your
|
|
<envar>MANPATH</envar> variable or to
|
|
<filename>/etc/man.conf</filename></para>
|
|
|
|
<para>The <application>Java</application> plugin is in the directory
|
|
<filename class="directory">$JAVA_HOME/jre/plugin/i?86/ns610/</filename>.
|
|
Make a symbolic link to the file in that directory from your plugins directory.
|
|
</para>
|
|
|
|
</sect3>
|
|
|
|
<sect3><title>Handling CLASSPATH</title>
|
|
|
|
<para>When compiling packages, the <envar>CLASSPATH</envar> environment variable
|
|
is used JDK to locate classes at compile-time and run-time. It is tedious to
|
|
add all the classes used to the <envar>CLASSPATH</envar> manually. You may add
|
|
the following lines to your shell startup file to set <envar>CLASSPATH</envar>
|
|
automatically to include all JAR files in a specified directory, which in
|
|
the example below is <filename>/usr/lib/auto-java-classpath</filename>.</para>
|
|
|
|
<screen><userinput>AUTO_CLASSPATH_DIR=/usr/lib/auto-java-classpath
|
|
if [ -z $CLASSPATH ]
|
|
then
|
|
CLASSPATH=.:$AUTO_CLASSPATH_DIR
|
|
else
|
|
CLASSPATH=$CLASSPATH:.:$AUTO_CLASSPATH_DIR
|
|
fi
|
|
for i in $(ls $AUTO_CLASSPATH_DIR/*.jar 2>/dev/null)
|
|
do
|
|
CLASSPATH=$CLASSPATH:$i
|
|
done</userinput></screen>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
|
|