glfs/general/prog/jdk/j2sdk-inst.xml
Tushar Teredesai 3f6090476a Fixed j2sdk typos
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@1744 af4574ff-66df-0310-9fd7-8a98e5e911e0
2004-02-01 03:30:10 +00:00

96 lines
3.8 KiB
XML

<sect2>
<title>Installation of <application>J2SDK</application></title>
<para>Both versions will be installed in parallel. You may choose to keep
either or both.</para>
<para>Installation of the precompiled <acronym>JDK</acronym> is easy, change
the executable bit for the downloaded file, change to the directory where you
want it installed and execute the downloaded file. The following (slightly
cryptic version) allows automatic installation.</para>
<screen><userinput><command>VERSION=&j2sdk-bin-version; &amp;&amp;
MV=`echo $VERSION | cut -d "_" -f 1,1` &amp;&amp;
V=`echo ${VERSION} | sed -e "s/\./_/g"` &amp;&amp;
sed -i "s:^PATH=.*::" j2sdk-${V}-linux-i?86.bin &amp;&amp;
chmod +x j2sdk-${V}-linux-i?86.bin &amp;&amp;
mkdir -p bin &amp;&amp;
ln -sf /bin/true bin/more &amp;&amp;
yes | PATH=$PWD/bin:$PATH ./j2sdk-${V}-linux-i?86.bin &amp;&amp;
cd j2sdk${VERSION} &amp;&amp;
install -d /opt/j2sdk/j2sdk-precompiled-${MV} &amp;&amp;
mv * /opt/j2sdk/j2sdk-precompiled-${MV}</command></userinput></screen>
<para>The binary version is now installed.</para>
<para>If you don't want to compile the source or are not in a postition to download the source
owing to license restrictions, skip ahead to the configuration
section.</para>
<para>Add the recently compiled <acronym>JDK</acronym> to the path.</para>
<screen><userinput><command>export JAVA_HOME=/opt/j2sdk/j2sdk-precompiled-${MV} &amp;&amp;
export PATH=$PATH:${JAVA_HOME}/bin</command></userinput></screen>
<para>Unzip the source:</para>
<screen><userinput><command>VERSION=&j2sdk-src-version; &amp;&amp;
V=`echo $VERSION | sed -e "s/\./_/g"` &amp;&amp;
unzip j2sdk-${V}-src-scsl.zip &amp;&amp;
unzip j2sdk-${V}-mozilla_headers-unix.zip &amp;&amp;
unzip j2sdk-${V}-bin-scsl.zip</command></userinput></screen>
<para>Apply all the patches downloaded above.</para>
<screen><userinput><command>for PATCH in fix-inline-asm-1 gcc33-1 motif-mkmsgcat \
remove-debug-image remove-fixed-paths-1 \
static_cxx
do
patch -Np1 -i j2sdk-1.4.2-$PATCH.patch
done</command></userinput></screen>
<para>Set/unset some variables which affect the build:</para>
<screen><userinput><command>export ALT_BOOTDIR="$JAVA_HOME" &amp;&amp;
unset JAVA_HOME &amp;&amp;
unset CLASSPATH
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
export ALT_DEVTOOLS_PATH="/usr/bin" &amp;&amp;
export BUILD_NUMBER="blfs-`date +%s`" &amp;&amp;
export DEV_ONLY=true &amp;&amp;
export ALT_MOZILLA_PATH=$PWD &amp;&amp;
export INSANE=true &amp;&amp;
export MAKE_VERBOSE=true &amp;&amp;
export ALT_CACERTS_FILE=${ALT_BOOTDIR}/jre/lib/security/cacerts</command></userinput></screen>
<warning><para>Setting CFLAGS/CXXFLAGS/LDFLAGS is guaranteed to make the build fail.
If you are interested in optimizing the build, set OTHER_CFLAGS/OTHER_CXXFLAGS/OTHER_LDFLAGS
instead.</para></warning>
<para>Additionally, if you would like to make in parallel, add the following
(adjust <envar>MAKE_PARALLEL</envar> to your liking):</para>
<screen><userinput><command>export HOTSPOT_BUILD_JOBS=$MAKE_PARALLEL</command></userinput></screen>
<para>If the included <application>Motif</application> doesn't build properly, the
error is noticed much later in the build.
A solution is to build the <application>Motif</application>
library before compiling the <application>J2SDK</application>.</para>
<screen><userinput><command>cd motif/lib/Xm &amp;&amp;
make &amp;&amp;
cd ../../..</command></userinput></screen>
<para>Make and Install <application>J2SDK</application> with the following
commands. There will be a lot of messages about missing files that look like
errors. As long as the build doesn't stop, the messages are harmless, so ignore
them.</para>
<screen><userinput><command>cd control/make &amp;&amp;
make &amp;&amp;
cd ../.. &amp;&amp;
cd control/build/linux-i?86 &amp;&amp;
cp -a j2sdk-image /opt/j2sdk/j2sdk-&j2sdk-src-version;</command></userinput></screen>
</sect2>