2013-07-17 04:07:29 +08:00
|
|
|
<?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;
|
|
|
|
|
2015-10-12 04:28:40 +08:00
|
|
|
<!ENTITY anduin-download "&sources-anduin-http;/OpenJDK/OpenJDK-&openjdk-version;">
|
2017-01-26 04:36:16 +08:00
|
|
|
<!ENTITY openjdk-download-binary-x86 "&anduin-download;/OpenJDK-&openjdk-version;-i686-bin.tar.xz">
|
2017-08-02 01:55:46 +08:00
|
|
|
<!ENTITY openjdk-bin-md5sum-x86 "08ea7bd6d308382d9fb605ffe1599d15">
|
2014-11-20 05:26:43 +08:00
|
|
|
<!ENTITY openjdk-bin-size-x86 "57 MB">
|
2017-04-30 04:22:32 +08:00
|
|
|
<!ENTITY openjdk-bin-buildsize-x86 "167 MB">
|
2013-07-17 04:07:29 +08:00
|
|
|
|
2017-01-26 04:36:16 +08:00
|
|
|
|
2013-07-17 04:07:29 +08:00
|
|
|
<!ENTITY openjdk-download-binary-x64 "&anduin-download;/OpenJDK-&openjdk-version;-x86_64-bin.tar.xz">
|
2017-08-02 01:55:46 +08:00
|
|
|
<!ENTITY openjdk-bin-md5sum-x64 "e924a6923dc156e9f65ca53fffcdcf30">
|
2015-05-03 02:11:03 +08:00
|
|
|
<!ENTITY openjdk-bin-size-x64 "58 MB">
|
2016-09-01 23:23:07 +08:00
|
|
|
<!ENTITY openjdk-bin-buildsize-x64 "170 MB">
|
2013-07-17 04:07:29 +08:00
|
|
|
]>
|
|
|
|
|
2014-08-27 21:15:54 +08:00
|
|
|
<sect1 id="java" xreflabel="Java-&openjdk-version;">
|
2013-07-17 04:07:29 +08:00
|
|
|
<?dbhtml filename="java.html"?>
|
|
|
|
|
|
|
|
<sect1info>
|
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
|
|
|
</sect1info>
|
|
|
|
|
2014-03-30 04:32:20 +08:00
|
|
|
<title>Java-&openjdk-version;</title>
|
2013-07-17 04:07:29 +08:00
|
|
|
|
|
|
|
<indexterm zone="java">
|
|
|
|
<primary sortas="a-java">JDK Binary</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
|
2014-03-30 04:32:20 +08:00
|
|
|
<sect2>
|
|
|
|
<title>About Java</title>
|
|
|
|
<para>Java is different from most of the packages in LFS and BLFS. It
|
|
|
|
is a programming language that works with files of byte codes to obtain
|
2015-11-13 22:24:57 +08:00
|
|
|
instructions and executes then in a Java Virtual Machine (JVM). An
|
2014-03-30 04:32:20 +08:00
|
|
|
introductory java program looks like:</para>
|
2013-07-17 04:07:29 +08:00
|
|
|
|
2015-11-13 22:24:57 +08:00
|
|
|
<screen><literal>public class HelloWorld
|
2013-07-17 04:07:29 +08:00
|
|
|
{
|
2015-11-13 22:24:57 +08:00
|
|
|
public static void main(String[] args)
|
2013-07-17 04:07:29 +08:00
|
|
|
{
|
|
|
|
System.out.println("Hello, World");
|
|
|
|
}
|
|
|
|
}</literal></screen>
|
|
|
|
|
2014-03-30 04:32:20 +08:00
|
|
|
<para>This program is saved as <filename>HelloWorld.java</filename>. The
|
|
|
|
file name, <emphasis>HelloWorld</emphasis>, must match the class name. It
|
|
|
|
is then converted into byte code with
|
|
|
|
<command>javac HelloWorld.java</command>. The output file is
|
|
|
|
<filename>HelloWorld.class</filename>. The program is executed with
|
|
|
|
<command>java HelloWorld</command>. This creates a JVM and runs the
|
|
|
|
code. The 'class' extension must not be specified.</para>
|
|
|
|
|
|
|
|
<para>Several class files can be combined into one file with the
|
|
|
|
<command>jar</command> command. This is similar to the standard
|
|
|
|
<command>tar</command> command. For instance, the command
|
|
|
|
<command>jar cf myjar.jar *.class</command> will combine all class files
|
|
|
|
in a directory into one jar file. These act as library files.</para>
|
|
|
|
|
|
|
|
<para>The JVM can search for and use classes in jar files automatically.
|
|
|
|
It uses the <envar>CLASSPATH</envar> environment variable to search for
|
|
|
|
jar files. This is a standard list of colon-separated directory names
|
|
|
|
similar to the <envar>PATH</envar> environment variable.</para>
|
2015-11-13 22:24:57 +08:00
|
|
|
|
2014-03-30 04:32:20 +08:00
|
|
|
</sect2>
|
2013-07-17 04:07:29 +08:00
|
|
|
|
2014-03-30 01:05:09 +08:00
|
|
|
<sect2 id="java-bin" xreflabel="Java Binary" role="package">
|
|
|
|
<title>Binary JDK Information</title>
|
2013-07-17 04:07:29 +08:00
|
|
|
|
|
|
|
<para>Creating a JVM from source requires a set of circular dependencies.
|
|
|
|
The first thing that's needed is a set of programs called a Java Development
|
2015-11-13 22:24:57 +08:00
|
|
|
Kit (JDK). This set of programs includes <command>java</command>,
|
|
|
|
<command>javac</command>, <command>jar</command>, and several others. It
|
2013-07-17 04:07:29 +08:00
|
|
|
also includes several base <emphasis>jar</emphasis> files.</para>
|
|
|
|
|
|
|
|
<para>To start, we set up a binary installation of the JDK created
|
|
|
|
by the BLFS editors. It is installed in the <filename>/opt</filename>
|
|
|
|
directory to allow for multiple installations, including a source based
|
|
|
|
version.</para>
|
|
|
|
|
2017-02-22 06:52:57 +08:00
|
|
|
&lfs80_checked;
|
2014-03-30 04:32:20 +08:00
|
|
|
|
2013-07-17 04:07:29 +08:00
|
|
|
<bridgehead renderas="sect3">Binary Package Information</bridgehead>
|
|
|
|
<itemizedlist spacing="compact">
|
|
|
|
<listitem>
|
|
|
|
<para>Binary download (x86):
|
|
|
|
<ulink url="&openjdk-download-binary-x86;"/></para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download MD5 sum: &openjdk-bin-md5sum-x86;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download size (binary): &openjdk-bin-size-x86;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Estimated disk space required: &openjdk-bin-buildsize-x86;</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
<itemizedlist spacing="compact">
|
|
|
|
<listitem>
|
|
|
|
<para>Binary download (x86_64):
|
|
|
|
<ulink url="&openjdk-download-binary-x64;"/></para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download MD5 sum: &openjdk-bin-md5sum-x64;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Download size (binary): &openjdk-bin-size-x64;</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>Estimated disk space required: &openjdk-bin-buildsize-x64;</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
2014-02-22 08:09:26 +08:00
|
|
|
|
|
|
|
<bridgehead renderas="sect3">Java Binary Runtime Dependencies</bridgehead>
|
|
|
|
<para role="required">
|
2014-07-24 04:19:35 +08:00
|
|
|
<xref linkend="alsa-lib"/>,
|
2014-02-22 08:09:26 +08:00
|
|
|
<xref linkend="cups"/>,
|
2014-11-20 05:26:43 +08:00
|
|
|
<xref linkend="giflib"/>, and
|
2014-02-22 08:09:26 +08:00
|
|
|
<xref linkend="xorg7-lib"/>
|
|
|
|
</para>
|
2014-03-30 04:32:20 +08:00
|
|
|
|
2014-03-30 01:05:09 +08:00
|
|
|
</sect2>
|
2014-02-22 08:09:26 +08:00
|
|
|
|
2014-03-30 01:05:09 +08:00
|
|
|
<sect2 role="installation">
|
|
|
|
<title>Installation of the Java BinaryJDK </title>
|
2013-07-17 04:07:29 +08:00
|
|
|
<para>Begin by extracting the appropriate binary tarball for your
|
2013-07-17 22:09:25 +08:00
|
|
|
architecture and changing to the extracted directory. Install the binary
|
2013-07-17 04:07:29 +08:00
|
|
|
<application>OpenJDK</application> with the following commands as the
|
|
|
|
<systemitem class="username">root</systemitem> user:</para>
|
|
|
|
|
|
|
|
<screen role="root"><userinput>install -vdm755 /opt/OpenJDK-&openjdk-version;-bin &&
|
|
|
|
mv -v * /opt/OpenJDK-&openjdk-version;-bin &&
|
|
|
|
chown -R root:root /opt/OpenJDK-&openjdk-version;-bin</userinput></screen>
|
|
|
|
|
2015-03-05 06:17:44 +08:00
|
|
|
<para>
|
|
|
|
The binary version is now installed. You may create a symlink to that
|
|
|
|
version by issuing, as the <systemitem class="username">root</systemitem>
|
|
|
|
user:
|
|
|
|
</para>
|
|
|
|
|
2015-07-30 03:38:25 +08:00
|
|
|
<screen role="root"><userinput>ln -sfn OpenJDK-&openjdk-version;-bin /opt/jdk</userinput></screen>
|
2015-03-05 06:17:44 +08:00
|
|
|
|
|
|
|
<para>
|
|
|
|
You may now proceed to <xref linkend="ojdk-conf"/>, where the
|
|
|
|
instructions assume that the above link exists.
|
|
|
|
</para>
|
2014-08-27 21:15:54 +08:00
|
|
|
|
2013-07-17 04:07:29 +08:00
|
|
|
</sect2>
|
|
|
|
|
|
|
|
</sect1>
|