JDK
Binary Download: | http://java.sun.com/j2se/1.5.0/download.jsp (to download jdk-1_5_0_10-linux-amd64.bin) |
---|
The following installation instructions only cover the installation of the 64-bit precompiled binaries. If you want or need plugins, you must install the 32-bit version on a pure 32-bit or multilib system.
Contents
Dependencies
No packages, but read note below in non-multilib section.
Non-Multilib
Precompiled Binaries
NOTE: The JDK binary installation script for 64-bit systems has the dynamic linker path hard-coded at /lib64/ld-linux-x86-64.so.2. If installing on a pure 64-bit system the dynamic linker will be installed in /lib. Changing this path manually or with a sed in the *.bin corrupts the *.bin and the install will fail. It is necessary to create a /lib64 directory and a symlink to /lib/ld-2.4.so before attempting to unpack and install the Java binary.
It appears that this link MUST REMAIN after installing the Java binaries. Removing it and attempting to execute any of the Java programs results in "No such file or directory."
Create the link.
mkdir -v /lib64 && ln -sv /lib/ld-2.4.so /lib64/ld-linux-x86-64.so.2
To install the JDK binary you will be required to accept the license agreement. Unpack the JDK binary.
cp -v jdk-1_5_0_10-linux-amd64.bin jdk-mod.bin && chmod +x jdk-mod.bin && ./jdk-mod.bin
As the root user, install the precompiled binaries.
cd jdk1.5.0_10 && install -v -d /opt/jdk/jdk-precompiled-1.5.0_10 && mv -v * /opt/jdk/jdk-precompiled-1.5.0_10 && chown -v -R root:root /opt/jdk/jdk-precompiled-1.5.0_10 && ln -v -sf motif21/libmawt.so \ /opt/jdk/jdk-precompiled-1.5.0_10/jre/lib/amd64/ && cd ..
Source Build
TO DO. Need smart guy for this.
Multilib
TO DO. Need smart guy for this.
Configuration
Create a link to the directory of the Java you wish to use (precompiled or built from source).
ln -v -nsf jdk-precompiled-1.5.0_10 /opt/jdk/jdk
Add a shell startup file to the /etc/profile.d directory with the following commands as the "root" user:
cat > /etc/profile.d/jdk.sh << "EOF" # Begin /etc/profile.d/jdk.sh # Set JAVA_HOME directory JAVA_HOME=/opt/jdk/jdk export JAVA_HOME # Adjust PATH pathappend ${JAVA_HOME}/bin PATH # Auto Java Classpath Updating # Create symlinks to this directory for auto classpath setting AUTO_CLASSPATH_DIR=/usr/lib/classpath if [ -z ${CLASSPATH} ]; then CLASSPATH=.:${AUTO_CLASSPATH_DIR} else CLASSPATH="${CLASSPATH}:.:${AUTO_CLASSPATH_DIR}" fi # Check for empty AUTO_CLASSPATH_DIR ls ${AUTO_CLASSPATH_DIR}/*.jar &> /dev/null && for i in ${AUTO_CLASSPATH_DIR}/*.jar do CLASSPATH=${CLASSPATH}:"${i}" done export CLASSPATH # End /etc/profile.d/jdk.sh EOF