Installation of J2SDK
Both versions will be installed in parallel. You may choose to keep
either or both.
Installation of the precompiled JDK 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.
VERSION=&j2sdk-bin-version; &&
MV=`echo $VERSION | cut -d "_" -f 1,1` &&
V=`echo ${VERSION} | sed -e "s/\./_/g"` &&
sed -i "s:^PATH=.*::" j2sdk-${V}-linux-i?86.bin &&
chmod +x j2sdk-${V}-linux-i?86.bin &&
mkdir -p bin &&
ln -sf /bin/true bin/more &&
yes | PATH=$PWD/bin:$PATH ./j2sdk-${V}-linux-i?86.bin &&
cd j2sdk${VERSION} &&
install -d /opt/j2sdk/j2sdk-precompiled-${MV} &&
mv * /opt/j2sdk/j2sdk-precompiled-${MV}
The binary version is now installed.
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.
Add the recently compiled JDK to the path.
export JAVA_HOME=/opt/j2sdk/j2sdk-precompiled-${MV} &&
export PATH=$PATH:${JAVA_HOME}/bin
Unzip the source:
VERSION=&j2sdk-src-version; &&
V=`echo $VERSION | sed -e "s/\./_/g"` &&
unzip j2sdk-${V}-src-scsl.zip &&
unzip j2sdk-${V}-mozilla_headers-unix.zip &&
unzip j2sdk-${V}-bin-scsl.zip
Apply all the patches downloaded above.
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
Set/unset some variables which affect the build:
export ALT_BOOTDIR="$JAVA_HOME" &&
unset JAVA_HOME &&
unset CLASSPATH
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
export ALT_DEVTOOLS_PATH="/usr/bin" &&
export BUILD_NUMBER="blfs-`date +%s`" &&
export DEV_ONLY=true &&
export ALT_MOZILLA_PATH=$PWD &&
export INSANE=true &&
export MAKE_VERBOSE=true &&
export ALT_CACERTS_FILE=${ALT_BOOTDIR}/jre/lib/security/cacerts
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.
Additionally, if you would like to make in parallel, add the following
(adjust MAKE_PARALLEL to your liking):
export HOTSPOT_BUILD_JOBS=$MAKE_PARALLEL
If the included Motif doesn't build properly, the
error is noticed much later in the build.
A solution is to build the Motif
library before compiling the J2SDK.
cd motif/lib/Xm &&
make &&
cd ../../..
Make and Install J2SDK 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.
cd control/make &&
make &&
cd ../.. &&
cd control/build/linux-i?86 &&
cp -a j2sdk-image /opt/j2sdk/j2sdk-&j2sdk-src-version;