<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;

  <!ENTITY jdk-download-http   "http://java.sun.com/javase/downloads/index.jsp">
  <!ENTITY jdk-md5sum          "ad5ee976522bf5767100a8b4b981c690">
  <!ENTITY jdk-size            "85 MB">
  <!ENTITY jdk-buildsize       "250 MB">
  <!ENTITY jdk-bin-version     "6u18">
  <!ENTITY jdk-build-time      "0.1 SBU">
  <!ENTITY jdk-version-string  "1.6.0_18">

]>

<sect1 id="jdk" xreflabel="JDK-&jdk-version;">
  <?dbhtml filename="jdk.html" ?>

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2012-05-12 17:26:38 -0400 (Sat, 12 May 2012) $</date>
  </sect1info>

  <title>JDK-&jdk-version;</title>

  <indexterm zone="jdk">
    <primary sortas="a-JDK">JDK</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to JDK</title>

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


<!--
    <note><para>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
    <ulink url="http://openjdk.java.net/projects/jdk6/">OpenJDK</ulink>.
    This new JDK will be licensed under the
    <ulink url="http://openjdk.java.net/legal/gplv2+ce.html">GNU General
    Public License, version 2, with the Classpath Exception</ulink>.
    A stable OpenJDK was not available at the time of writing.</para></note>
-->

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>Download (jdk-&jdk-bin-version;-linux-i586.bin):
        <ulink url="&jdk-download-http;"/></para>
      </listitem>
      <listitem>
        <para>Download MD5 sum: &jdk-md5sum;</para>
      </listitem>
      <listitem>
        <para>Download size (binary): &jdk-size;</para>
      </listitem>
      <listitem>
        <para>Estimated disk space required: &jdk-buildsize;</para>
      </listitem>
      <listitem>
        <para>Estimated build time: &jdk-build-time;</para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">JDK Dependencies</bridgehead>

    <bridgehead renderas="sect4">Optional Runtime Dependencies</bridgehead>
    <para role="optional">
    <xref linkend="alsa-lib"/>,
    <xref linkend="cups"/>, and
    <xref linkend="gtk2"/></para>

    <para condition="html" role="usernotes">User Notes:
    <ulink url="&blfs-wiki;/jdk"/></para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of JDK</title>

    <tip>
      <para>The <command>./jdk-&jdk-bin-version;-linux-i586.bin</command>
      command below unpacks the distribution into a
      <filename class='directory'>jdk&jdk-version-string;</filename>
      directory.  You will be required to view, and then accept (by entering a
      <keycap>y</keycap> 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 <xref linkend="automating-builds"/> section of Chapter 2. Towards
      the end of this section, specific information for automating this type of
      installation is discussed.</para>
    </tip>

    <para>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.</para>

    <para>Install the <application>JDK</application> with the
    following commands:</para>

<screen><userinput>chmod 755 jdk-&jdk-bin-version;-linux-i586.bin &amp;&amp;
./jdk-&jdk-bin-version;-linux-i586.bin</userinput></screen>

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

    <para>Now, as the <systemitem class="username">root</systemitem> user:</para>

<screen role="root"><userinput>cd jdk&jdk-version-string; &amp;&amp;
install -v -m755 -d /opt/jdk-&jdk-bin-version; &amp;&amp;
mv -v * /opt/jdk-&jdk-bin-version; &amp;&amp;
chown -v -R root:root /opt/jdk-&jdk-bin-version; &amp;&amp;
ln -v -sf xawt/libmawt.so \
    /opt/jdk-&jdk-bin-version;/jre/lib/i386/ &amp;&amp;
cd ..</userinput></screen>

    <para>Recent versions of libX11 break libmawt
    when used with the Xinerama extension.  While still the
    <systemitem class="username">root</systemitem> user, apply the
    following sed to work around this problem:</para>

<screen role="root"><userinput>sed -i 's@XINERAMA@FAKEEXTN@g' \
    /opt/jdk-&jdk-bin-version;/jre/lib/i386/xawt/libmawt.so</userinput></screen>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <para><command>ln -sf xawt/libmawt.so
    /opt/jdk-&jdk-bin-version;/jre/lib/i386/</command>: This fixes
    linking issues with other applications that expect to find the
    <application>motif</application> libraries with the other
    <application>JDK</application> libraries.</para>

  </sect2>

  <sect2 role="configuration">
    <title>Configuring JDK</title>

    <sect3>
      <title>Configuration Information</title>

    <para>As the <systemitem class="username">root</systemitem> user, create
    a symlink to the installation directory:</para>

<screen role="root"><userinput>ln -v -nsf jdk-&jdk-bin-version; /opt/jdk</userinput></screen>

    <para>The information below assumes your system is set up using the
    instructions found in
    <quote><xref linkend="postlfs-config-profile"/></quote>. 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.</para>

    <para>Add the following <filename>jdk.sh</filename> shell startup file to
    the <filename>/etc/profile.d</filename> directory with the following
    commands as the <systemitem class="username">root</systemitem> user:</para>

<screen role="root"><userinput>cat &gt; /etc/profile.d/jdk.sh &lt;&lt; "EOF"
<literal># 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</literal>
EOF</userinput></screen>

    <para>The <application>Java</application> plugin is located at
    <filename class="directory">$JAVA_HOME/jre/lib/i386/libnpjp2.so</filename>.
    Make a symbolic link to the file from your browser(s) plugins
    directory.</para>

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

    </sect3>

  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Programs</segtitle>
      <segtitle>Installed Libraries</segtitle>
      <segtitle>Installed Directory</segtitle>

      <seglistitem>
        <seg>appletviewer, apt, extcheck, idlj, HtmlConverter, jar,
        jarsigner, java, javac, javadoc, javah, javap, java-rmi.cgi,
        javaws, jconsole, jcontrol, jdb, jhat, jinfo, jmap, jps,
        jrunscript, jsadebugd, jstack, jstat, jstatd, jvisualvm, keytool,
        native2ascii, orbd, pack200, policytool, rmic, rmid, rmiregistry,
        schemagen, serialver, servertool, tnameserv, unpack200,
        wsgen, wsimport, and xjc</seg>
        <seg><envar>$JAVA_HOME</envar>/lib/*,
        <envar>$JAVA_HOME</envar>/jre/lib/*</seg>
        <seg>/opt/jdk-&jdk-bin-version;</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="appletviewer">
        <term><command>appletviewer</command></term>
        <listitem>
          <para>runs Java applets outside of the context of a browser.</para>
          <indexterm zone="jdk appletviewer">
            <primary sortas="b-appletviewer">appletviewer</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="apt">
        <term><command>apt</command></term>
        <listitem>
          <para>is an annotation processing tool.</para>
          <indexterm zone="jdk apt">
            <primary sortas="b-apt">apt</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="extcheck">
        <term><command>extcheck</command></term>
        <listitem>
          <para>checks a specified jar file for title and version conflicts
          with any extensions installed in the <application>JDK</application>
          software.</para>
          <indexterm zone="jdk extcheck">
            <primary sortas="b-extcheck">extcheck</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="HtmlConverter">
        <term><command>HtmlConverter</command></term>
        <listitem>
          <para>adds Java auto download to html and asp pages. </para>
          <indexterm zone="jdk HtmlConverter">
            <primary sortas="b-HtmlConverter">HtmlConverter</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="idlj">
        <term><command>idlj</command></term>
        <listitem>
          <para>generates Java bindings from a given IDL file.</para>
          <indexterm zone="jdk idlj">
            <primary sortas="b-idlj">idlj</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jar">
        <term><command>jar</command></term>
        <listitem>
          <para>combines multiple files into a single jar archive.</para>
          <indexterm zone="jdk jar">
            <primary sortas="b-jar">jar</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jarsigner">
        <term><command>jarsigner</command></term>
        <listitem>
          <para>signs jar files and verifies the signatures and integrity
          of a signed jar file.</para>
          <indexterm zone="jdk jarsigner">
            <primary sortas="b-jarsigner">jarsigner</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="java">
        <term><command>java</command></term>
        <listitem>
          <para>launches a Java application by starting a Java runtime
          environment, loading a specified class and invoking its main
          method.</para>
          <indexterm zone="jdk java">
            <primary sortas="b-java">java</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="javac">
        <term><command>javac</command></term>
        <listitem>
          <para>reads class and interface definitions, written in the
          Java programming language, and compiles them into bytecode
          class files.</para>
          <indexterm zone="jdk javac">
            <primary sortas="b-javac">javac</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="javadoc">
        <term><command>javadoc</command></term>
        <listitem>
          <para>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.</para>
          <indexterm zone="jdk javadoc">
            <primary sortas="b-javadoc">javadoc</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="javah">
        <term><command>javah</command></term>
        <listitem>
          <para>generates C header and source files
          that are needed to implement native methods.</para>
          <indexterm zone="jdk javah">
            <primary sortas="b-javah">javah</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="javap">
        <term><command>javap</command></term>
        <listitem>
          <para>disassembles a Java class file.</para>
          <indexterm zone="jdk javap">
            <primary sortas="b-javap">javap</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="java-rmi.cgi">
        <term><command>java-rmi.cgi</command></term>
        <listitem>
          <para>is the Java RMI client.</para>
          <indexterm zone="jdk java-rmi.cgi">
            <primary sortas="b-java-rmi.cgi">java-rmi.cgi</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="javaws">
        <term><command>javaws</command></term>
        <listitem>
          <para>launches Java application/applets hosted on a network.</para>
          <indexterm zone="jdk javaws">
            <primary sortas="b-javaws">javaws</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jconsole">
        <term><command>jconsole</command></term>
        <listitem>
          <para>is a graphical console tool to monitor and manage both
          local and remote Java applications and virtual machines.</para>
          <indexterm zone="jdk jconsole">
            <primary sortas="b-jconsole">jconsole</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jcontrol">
        <term><command>jcontrol</command></term>
        <listitem>
          <para>is a graphical control panel for Java.</para>
          <indexterm zone="jdk jcontrol">
            <primary sortas="b-jcontrol">jcontrol</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jdb">
        <term><command>jdb</command></term>
        <listitem>
          <para>is a simple command-line debugger for Java classes.</para>
          <indexterm zone="jdk jdb">
            <primary sortas="b-jdb">jdb</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jhat">
        <term><command>jhat</command></term>
        <listitem>
          <para>parses a java heap dump file and allows viewing
          in a webbrowser.</para>
          <indexterm zone="jdk jhat">
            <primary sortas="b-jhat">jhat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jinfo">
        <term><command>jinfo</command></term>
        <listitem>
          <para>prints Java configuration information for a given Java
          process, core file, or a remote debug server.</para>
          <indexterm zone="jdk jinfo">
            <primary sortas="b-jinfo">jinfo</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jmap">
        <term><command>jmap</command></term>
        <listitem>
          <para>prints shared object memory maps or heap memory details
          of a given process, core file, or a remote debug server.</para>
          <indexterm zone="jdk jmap">
            <primary sortas="b-jmap">jmap</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jps">
        <term><command>jps</command></term>
        <listitem>
          <para>lists the instrumented JVMs on the target system.</para>
          <indexterm zone="jdk jps">
            <primary sortas="b-jps">jps</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jrunscript">
        <term><command>jrunscript</command></term>
        <listitem>
          <para>is a command line script shell.</para>
          <indexterm zone="jdk jrunscript">
            <primary sortas="b-jrunscript">jrunscript</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jsadebugd">
        <term><command>jsadebugd</command></term>
        <listitem>
          <para>attaches to a Java process or core file and acts as a
          debug server.</para>
          <indexterm zone="jdk jsadebugd">
            <primary sortas="b-jsadebugd">jsadebugd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jstack">
        <term><command>jstack</command></term>
        <listitem>
          <para>prints Java stack traces of Java threads for a given
          Java process, core file, or a remote debug server.</para>
          <indexterm zone="jdk jstack">
            <primary sortas="b-jstack">jstack</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jstat">
        <term><command>jstat</command></term>
        <listitem>
          <para>displays performance statistics for an instrumented JVM.</para>
          <indexterm zone="jdk jstat">
            <primary sortas="b-jstat">jstat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jstatd">
        <term><command>jstatd</command></term>
        <listitem>
          <para>is an RMI server application that monitors for the creation
          and termination of instrumented JVMs.</para>
          <indexterm zone="jdk jstatd">
            <primary sortas="b-jstatd">jstatd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jvisualvm">
        <term><command>jvisualvm</command></term>
        <listitem>
          <para>is an intuitive graphical user interface that provides detailed
          information about Java applications while they are running on a given
          JVM.</para>
          <indexterm zone="jdk jvisualvm">
            <primary sortas="b-jvisualvm">jvisualvm</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="keytool">
        <term><command>keytool</command></term>
        <listitem>
          <para>is a key and certificate management utility.</para>
          <indexterm zone="jdk keytool">
            <primary sortas="b-keytool">keytool</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="native2ascii">
        <term><command>native2ascii</command></term>
        <listitem>
          <para> converts files that contain non-supported character encoding
          into files containing Latin-1 or Unicode-encoded characters.</para>
          <indexterm zone="jdk native2ascii">
            <primary sortas="b-native2ascii">native2ascii</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="orbd">
        <term><command>orbd</command></term>
        <listitem>
          <para>is used to enable clients to transparently locate and invoke
          persistent objects on servers in the CORBA environment.</para>
          <indexterm zone="jdk orbd">
            <primary sortas="b-orbd">orbd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pack200">
        <term><command>pack200</command></term>
        <listitem>
          <para>is a Java application that transforms a jar file into a
          compressed pack200 file using the Java gzip compressor.</para>
          <indexterm zone="jdk pack200">
            <primary sortas="b-pack200">pack200</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="policytool">
        <term><command>policytool</command></term>
        <listitem>
          <para>creates and manages a policy file graphically.</para>
          <indexterm zone="jdk policytool">
            <primary sortas="b-policytool">policytool</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rmic">
        <term><command>rmic</command></term>
        <listitem>
          <para>generates stub and skeleton class files for remote objects
          from the names of compiled Java classes that contain remote
          object implementations.</para>
          <indexterm zone="jdk rmic">
            <primary sortas="b-rmic">rmic</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rmid">
        <term><command>rmid</command></term>
        <listitem>
          <para>starts the activation system daemon.</para>
          <indexterm zone="jdk rmid">
            <primary sortas="b-rmid">rmid</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rmiregistry">
        <term><command>rmiregistry</command></term>
        <listitem>
          <para>creates and starts a remote object registry on the specified
          port on the current host.</para>
          <indexterm zone="jdk rmiregistry">
            <primary sortas="b-rmiregistry">rmiregistry</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="schemagen">
        <term><command>schemagen</command></term>
        <listitem>
          <para>is a Java XML binding schema generator.</para>
          <indexterm zone="jdk schemagen">
            <primary sortas="b-schemagen">schemagen</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="serialver">
        <term><command>serialver</command></term>
        <listitem>
          <para>returns the serialVersionUID for one or more classes in a
          form suitable for copying into an evolving class.</para>
          <indexterm zone="jdk serialver">
            <primary sortas="b-serialver">serialver</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="servertool">
        <term><command>servertool</command></term>
        <listitem>
          <para>provides an ease-of-use interface for application programmers
          to register, unregister, startup and shutdown a server.</para>
          <indexterm zone="jdk servertool">
            <primary sortas="b-servertool">servertool</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tnameserv">
        <term><command>tnameserv</command></term>
        <listitem>
          <para>starts the Java IDL name server.</para>
          <indexterm zone="jdk tnameserv">
            <primary sortas="b-tnameserv">tnameserv</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="unpack200">
        <term><command>unpack200</command></term>
        <listitem>
          <para>is a native implementation that transforms a packed file
          produced by <application>pack200</application> into a jar
          file.</para>
          <indexterm zone="jdk unpack200">
            <primary sortas="b-unpack200">unpack200</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="wsgen">
        <term><command>wsgen</command></term>
        <listitem>
          <para>generates JAX-WS portable artifacts used in JAX-WS
          web services.</para>
          <indexterm zone="jdk wsgen">
            <primary sortas="b-wsgen">wsgen</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="wsimport">
        <term><command>wsimport</command></term>
        <listitem>
          <para>generates JAX-WS portable artifacts.</para>
          <indexterm zone="jdk wsimport">
            <primary sortas="b-wsimport">wsimport</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="xjc">
        <term><command>xjc</command></term>
        <listitem>
          <para>is a Java XML binding compiler.</para>
          <indexterm zone="jdk xjc">
            <primary sortas="b-xjc">xjc</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
