1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY anduin-download "&sources-anduin-http;/OpenJDK/OpenJDK-&openjdk-version;">
|
---|
8 | <!ENTITY openjdk-download-binary-x86 "&anduin-download;/OpenJDK-&openjdk-version;-i686-bin.tar.xz">
|
---|
9 | <!ENTITY openjdk-bin-md5sum-x86 "69a1c15a7381fd8de4a7d019971c078e">
|
---|
10 | <!ENTITY openjdk-bin-size-x86 "57 MB">
|
---|
11 | <!ENTITY openjdk-bin-buildsize-x86 "166 MB">
|
---|
12 |
|
---|
13 |
|
---|
14 | <!ENTITY openjdk-download-binary-x64 "&anduin-download;/OpenJDK-&openjdk-version;-x86_64-bin.tar.xz">
|
---|
15 | <!ENTITY openjdk-bin-md5sum-x64 "1aec751c6f406cbf1f48fc98ab7ead1c">
|
---|
16 | <!ENTITY openjdk-bin-size-x64 "58 MB">
|
---|
17 | <!ENTITY openjdk-bin-buildsize-x64 "170 MB">
|
---|
18 | ]>
|
---|
19 |
|
---|
20 | <sect1 id="java" xreflabel="Java-&openjdk-version;">
|
---|
21 | <?dbhtml filename="java.html"?>
|
---|
22 |
|
---|
23 | <sect1info>
|
---|
24 | <othername>$LastChangedBy$</othername>
|
---|
25 | <date>$Date$</date>
|
---|
26 | </sect1info>
|
---|
27 |
|
---|
28 | <title>Java-&openjdk-version;</title>
|
---|
29 |
|
---|
30 | <indexterm zone="java">
|
---|
31 | <primary sortas="a-java">JDK Binary</primary>
|
---|
32 | </indexterm>
|
---|
33 |
|
---|
34 |
|
---|
35 | <sect2>
|
---|
36 | <title>About Java</title>
|
---|
37 | <para>Java is different from most of the packages in LFS and BLFS. It
|
---|
38 | is a programming language that works with files of byte codes to obtain
|
---|
39 | instructions and executes then in a Java Virtual Machine (JVM). An
|
---|
40 | introductory java program looks like:</para>
|
---|
41 |
|
---|
42 | <screen><literal>public class HelloWorld
|
---|
43 | {
|
---|
44 | public static void main(String[] args)
|
---|
45 | {
|
---|
46 | System.out.println("Hello, World");
|
---|
47 | }
|
---|
48 | }</literal></screen>
|
---|
49 |
|
---|
50 | <para>This program is saved as <filename>HelloWorld.java</filename>. The
|
---|
51 | file name, <emphasis>HelloWorld</emphasis>, must match the class name. It
|
---|
52 | is then converted into byte code with
|
---|
53 | <command>javac HelloWorld.java</command>. The output file is
|
---|
54 | <filename>HelloWorld.class</filename>. The program is executed with
|
---|
55 | <command>java HelloWorld</command>. This creates a JVM and runs the
|
---|
56 | code. The 'class' extension must not be specified.</para>
|
---|
57 |
|
---|
58 | <para>Several class files can be combined into one file with the
|
---|
59 | <command>jar</command> command. This is similar to the standard
|
---|
60 | <command>tar</command> command. For instance, the command
|
---|
61 | <command>jar cf myjar.jar *.class</command> will combine all class files
|
---|
62 | in a directory into one jar file. These act as library files.</para>
|
---|
63 |
|
---|
64 | <para>The JVM can search for and use classes in jar files automatically.
|
---|
65 | It uses the <envar>CLASSPATH</envar> environment variable to search for
|
---|
66 | jar files. This is a standard list of colon-separated directory names
|
---|
67 | similar to the <envar>PATH</envar> environment variable.</para>
|
---|
68 |
|
---|
69 | </sect2>
|
---|
70 |
|
---|
71 | <sect2 id="java-bin" xreflabel="Java Binary" role="package">
|
---|
72 | <title>Binary JDK Information</title>
|
---|
73 |
|
---|
74 | <para>Creating a JVM from source requires a set of circular dependencies.
|
---|
75 | The first thing that's needed is a set of programs called a Java Development
|
---|
76 | Kit (JDK). This set of programs includes <command>java</command>,
|
---|
77 | <command>javac</command>, <command>jar</command>, and several others. It
|
---|
78 | also includes several base <emphasis>jar</emphasis> files.</para>
|
---|
79 |
|
---|
80 | <para>To start, we set up a binary installation of the JDK created
|
---|
81 | by the BLFS editors. It is installed in the <filename>/opt</filename>
|
---|
82 | directory to allow for multiple installations, including a source based
|
---|
83 | version.</para>
|
---|
84 |
|
---|
85 | &lfs80_checked;
|
---|
86 |
|
---|
87 | <bridgehead renderas="sect3">Binary Package Information</bridgehead>
|
---|
88 | <itemizedlist spacing="compact">
|
---|
89 | <listitem>
|
---|
90 | <para>Binary download (x86):
|
---|
91 | <ulink url="&openjdk-download-binary-x86;"/></para>
|
---|
92 | </listitem>
|
---|
93 | <listitem>
|
---|
94 | <para>Download MD5 sum: &openjdk-bin-md5sum-x86;</para>
|
---|
95 | </listitem>
|
---|
96 | <listitem>
|
---|
97 | <para>Download size (binary): &openjdk-bin-size-x86;</para>
|
---|
98 | </listitem>
|
---|
99 | <listitem>
|
---|
100 | <para>Estimated disk space required: &openjdk-bin-buildsize-x86;</para>
|
---|
101 | </listitem>
|
---|
102 | </itemizedlist>
|
---|
103 | <itemizedlist spacing="compact">
|
---|
104 | <listitem>
|
---|
105 | <para>Binary download (x86_64):
|
---|
106 | <ulink url="&openjdk-download-binary-x64;"/></para>
|
---|
107 | </listitem>
|
---|
108 | <listitem>
|
---|
109 | <para>Download MD5 sum: &openjdk-bin-md5sum-x64;</para>
|
---|
110 | </listitem>
|
---|
111 | <listitem>
|
---|
112 | <para>Download size (binary): &openjdk-bin-size-x64;</para>
|
---|
113 | </listitem>
|
---|
114 | <listitem>
|
---|
115 | <para>Estimated disk space required: &openjdk-bin-buildsize-x64;</para>
|
---|
116 | </listitem>
|
---|
117 | </itemizedlist>
|
---|
118 |
|
---|
119 | <bridgehead renderas="sect3">Java Binary Runtime Dependencies</bridgehead>
|
---|
120 | <para role="required">
|
---|
121 | <xref linkend="alsa-lib"/>,
|
---|
122 | <xref linkend="cups"/>,
|
---|
123 | <xref linkend="giflib"/>, and
|
---|
124 | <xref linkend="xorg7-lib"/>
|
---|
125 | </para>
|
---|
126 |
|
---|
127 | </sect2>
|
---|
128 |
|
---|
129 | <sect2 role="installation">
|
---|
130 | <title>Installation of the Java BinaryJDK </title>
|
---|
131 | <para>Begin by extracting the appropriate binary tarball for your
|
---|
132 | architecture and changing to the extracted directory. Install the binary
|
---|
133 | <application>OpenJDK</application> with the following commands as the
|
---|
134 | <systemitem class="username">root</systemitem> user:</para>
|
---|
135 |
|
---|
136 | <screen role="root"><userinput>install -vdm755 /opt/OpenJDK-&openjdk-version;-bin &&
|
---|
137 | mv -v * /opt/OpenJDK-&openjdk-version;-bin &&
|
---|
138 | chown -R root:root /opt/OpenJDK-&openjdk-version;-bin</userinput></screen>
|
---|
139 |
|
---|
140 | <para>
|
---|
141 | The binary version is now installed. You may create a symlink to that
|
---|
142 | version by issuing, as the <systemitem class="username">root</systemitem>
|
---|
143 | user:
|
---|
144 | </para>
|
---|
145 |
|
---|
146 | <screen role="root"><userinput>ln -sfn OpenJDK-&openjdk-version;-bin /opt/jdk</userinput></screen>
|
---|
147 |
|
---|
148 | <para>
|
---|
149 | You may now proceed to <xref linkend="ojdk-conf"/>, where the
|
---|
150 | instructions assume that the above link exists.
|
---|
151 | </para>
|
---|
152 |
|
---|
153 | </sect2>
|
---|
154 |
|
---|
155 | </sect1>
|
---|