JDK-6 Update 5

Introduction to JDK

The JDK package contains Sun's Java development environment. This is useful for developing Java programs and provides the runtime environment necessary to run Java programs. It also includes a plug-in for browsers so that they can be Java aware.

[Note]

Note

Sun has recently decided not to provide JRL sources for the latest update versions of the JDK. Sun is actively working on a GPL'd version of the JDK, titled OpenJDK. This new JDK will be licensed under the GNU General Public License, version 2, with the Classpath Exception. A stable OpenJDK was not available at the time of writing.

Package Information

  • Download (jdk-6u5-linux-i586.bin): http://java.sun.com/javase/downloads/index.jsp

  • Download MD5 sum: f7528500c17c09546566e05988beda86

  • Download size (binary): 67 MB

  • Estimated disk space required: 207 MB

  • Estimated build time: 0.2 SBU

JDK Dependencies

Optional Runtime Dependencies

ALSA Library-1.0.13, CUPS-1.2.12, and GTK+-2.10.13

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/jdk

Installation of JDK

[Tip]

Tip

The ./jdk-6u5-linux-i586.bin command below unpacks the distribution into a jdk1.6.0_05 directory. You will be required to view, and then accept (by entering a y keypress), a license agreement before any files are unpacked. If you are scripting (automating) the build, you'll need to account for this. There is information about automating build commands in the Automated Building Procedures section of Chapter 2. Towards the end of this section, specific information for automating this type of installation is discussed.

Normally in BLFS, the files are unpacked into a subdirectory and the starting point for the installation procedures is that location. For this application only, start in the directory where all the downloaded files are located.

Install the JDK with the following commands:

chmod 755 jdk-6u5-linux-i586.bin &&
./jdk-6u5-linux-i586.bin
[Note]

Note

The installation will end with a message "./jdk-6u5-linux-i586.bin: line 43: 20283 Aborted" as javaprefix is unset in the environment. This is by design as GTK+ may not be installed during the installation, however, the installation will still exit with a zero error value if scripting the build.

Now, as the root user:

cd jdk1.6.0_05 &&
install -v -m755 -d /opt/jdk-6u5 &&
mv -v * /opt/jdk-6u5 &&
chown -v -R root:root /opt/jdk-6u5 &&
ln -v -sf xawt/libmawt.so \
    /opt/jdk-6u5/jre/lib/i386/ &&
cd ..

Recent versions of libX11 break libmawt when used with the Xinerama extension. While still the root user, apply the following sed to work around this problem:

sed -i 's@XINERAMA@FAKEEXTN@g' \
    /opt/jdk-6u5/jre/lib/i386/xawt/libmawt.so

Command Explanations

ln -sf xawt/libmawt.so /opt/jdk-6u5/jre/lib/i386/: This fixes linking issues with other applications that expect to find the motif libraries with the other JDK libraries.

Configuring JDK

Configuration Information

As the root user, create a symlink to the installation directory:

ln -v -nsf jdk-6u5 /opt/jdk

The information below assumes your system is set up using the instructions found in “The Bash Shell Startup Files”. You may need to extract the relevant information below and incorporate it into your system's startup files if your system is set up differently.

Add the following jdk.sh 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

# Adjust PATH
pathappend ${JAVA_HOME}/bin PATH

# Auto Java CLASSPATH
# Copy jar files to, or create symlinks in this directory
AUTO_CLASSPATH_DIR=/usr/lib/classpath
pathprepend . CLASSPATH
for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
    pathappend $dir CLASSPATH
done

export JAVA_HOME CLASSPATH
unset AUTO_CLASSPATH_DIR
unset dir

# End /etc/profile.d/jdk.sh
EOF

The Java plugin is located in $JAVA_HOME/jre/plugin/i?86/ns7/. Make a symbolic link to the file in that directory from your browser(s) plugins directory.

[Important]

Important

The plugin must be a symlink for it to work. If not, the browsers will crash when you attempt to load a Java application.

Contents

Installed Programs: appletviewer, apt, extcheck, idlj, HtmlConverter, jar, jarsigner, java, javac, javadoc, javah, javap, java-rmi.cgi, javaws, jconsole, jdb, jhat, jinfo, jmap, jps, jrunscript, jsadebugd, jstack, jstat, jstatd, keytool, native2ascii, orbd, pack200, policytool, rmic, rmid, rmiregistry, schemagen, serialver, servertool, tnameserv, unpack200, wsgen, wsimport, and xjc
Installed Libraries: $JAVA_HOME/lib/*, $JAVA_HOME/jre/lib/*, and libjavaplugin_oji.so
Installed Directory: /opt/jdk-6u5

Short Descriptions

appletviewer

runs Java applets outside of the context of a browser.

apt

is an annotation processing tool.

extcheck

checks a specified jar file for title and version conflicts with any extensions installed in the JDK software.

HtmlConverter

adds Java auto download to html and asp pages.

idlj

generates Java bindings from a given IDL file.

jar

combines multiple files into a single jar archive.

jarsigner

signs jar files and verifies the signatures and integrity of a signed jar file.

java

launches a Java application by starting a Java runtime environment, loading a specified class and invoking its main method.

javac

reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files.

javadoc

parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages describing the classes, interfaces,constructors, methods, and fields.

javah

generates C header and source files that are needed to implement native methods.

javap

disassembles a Java class file.

java-rmi.cgi

is the Java RMI client.

javaws

launches Java application/applets hosted on a network.

jconsole

is a graphical console tool to monitor and manage both local and remote Java applications and virtual machines.

jdb

is a simple command-line debugger for Java classes.

jhat

parses a java heap dump file and allows viewing in a webbrowser.

jinfo

prints Java configuration information for a given Java process, core file, or a remote debug server.

jmap

prints shared object memory maps or heap memory details of a given process, core file, or a remote debug server.

jps

lists the instrumented JVMs on the target system.

jrunscript

is a command line script shell.

jsadebugd

attaches to a Java process or core file and acts as a debug server.

jstack

prints Java stack traces of Java threads for a given Java process, core file, or a remote debug server.

jstat

displays performance statistics for an instrumented JVM.

jstatd

is an RMI server application that monitors for the creation and termination of instrumented JVMs.

keytool

is a key and certificate management utility.

native2ascii

converts files that contain non-supported character encoding into files containing Latin-1 or Unicode-encoded characters.

orbd

is used to enable clients to transparently locate and invoke persistent objects on servers in the CORBA environment.

pack200

is a Java application that transforms a jar file into a compressed pack200 file using the Java gzip compressor.

policytool

creates and manages a policy file graphically.

rmic

generates stub and skeleton class files for remote objects from the names of compiled Java classes that contain remote object implementations.

rmid

starts the activation system daemon.

rmiregistry

creates and starts a remote object registry on the specified port on the current host.

schemagen

is a Java XML binding schema generator.

serialver

returns the serialVersionUID for one or more classes in a form suitable for copying into an evolving class.

servertool

provides an ease-of-use interface for application programmers to register, unregister, startup and shutdown a server.

tnameserv

starts the Java IDL name server.

unpack200

is a native implementation that transforms a packed file produced by pack200 into a jar file.

wsgen

generates JAX-WS portable artifacts used in JAX-WS web services.

wsimport

generates JAX-WS portable artifacts.

xjc

is a Java XML binding compiler.

Last updated on 2008-08-10 15:33:05 -0500