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 | <!-- Maintainer: before making the tarball, remove all .debuginfo files from
|
---|
8 | the directory: this saves more than 70 MB. -->
|
---|
9 | <!ENTITY anduin-download "&sources-anduin-http;/OpenJDK/OpenJDK-&openjdk-version;">
|
---|
10 | <!ENTITY openjdk-download-binary-x86 "&sources-anduin-http;/OpenJDK/OpenJDK-14.0.1/OpenJDK-14.0.1+7-i686-bin.tar.xz">
|
---|
11 | <!ENTITY openjdk-bin-md5sum-x86 "03bea53f017e53d64811c24a794368e0">
|
---|
12 | <!ENTITY openjdk-bin-size-x86 "109 MB">
|
---|
13 | <!ENTITY openjdk-bin-buildsize-x86 "242 MB">
|
---|
14 |
|
---|
15 | <!-- Not uploaded to anduin, since this file is now available under GNU GPLv2
|
---|
16 | licence.-->
|
---|
17 | <!ENTITY openjdk-download-binary-x64 "https://download.java.net/java/GA/jdk14.0.1/664493ef4a6946b186ff29eb326336a2/&openjdk-build;/GPL/openjdk-&openjdk-version;_linux-x64_bin.tar.gz">
|
---|
18 | <!ENTITY openjdk-bin-md5sum-x64 "8b402feab7c615367b21e289ddda665e">
|
---|
19 | <!ENTITY openjdk-bin-size-x64 "189 MB">
|
---|
20 | <!ENTITY openjdk-bin-buildsize-x64 "320 MB">
|
---|
21 | ]>
|
---|
22 |
|
---|
23 | <sect1 id="java" xreflabel="Java-&openjdk-version;">
|
---|
24 | <?dbhtml filename="java.html"?>
|
---|
25 |
|
---|
26 | <sect1info>
|
---|
27 | <othername>$LastChangedBy$</othername>
|
---|
28 | <date>$Date$</date>
|
---|
29 | </sect1info>
|
---|
30 |
|
---|
31 | <title>Java-&openjdk-version;</title>
|
---|
32 |
|
---|
33 | <indexterm zone="java">
|
---|
34 | <primary sortas="a-java">JDK Binary</primary>
|
---|
35 | </indexterm>
|
---|
36 |
|
---|
37 |
|
---|
38 | <sect2>
|
---|
39 | <title>About Java</title>
|
---|
40 | <para>
|
---|
41 | Java is different from most of the packages in LFS and BLFS. It
|
---|
42 | is a programming language that works with files of byte codes to obtain
|
---|
43 | instructions and executes then in a Java Virtual Machine (JVM). An
|
---|
44 | introductory java program looks like:
|
---|
45 | </para>
|
---|
46 |
|
---|
47 | <screen><literal>public class HelloWorld
|
---|
48 | {
|
---|
49 | public static void main(String[] args)
|
---|
50 | {
|
---|
51 | System.out.println("Hello, World");
|
---|
52 | }
|
---|
53 | }</literal></screen>
|
---|
54 |
|
---|
55 | <para>
|
---|
56 | This program is saved as <filename>HelloWorld.java</filename>. The
|
---|
57 | file name, <emphasis>HelloWorld</emphasis>, must match the class name.
|
---|
58 | It is then converted into byte code with
|
---|
59 | <command>javac HelloWorld.java</command>. The output file is
|
---|
60 | <filename>HelloWorld.class</filename>. The program is executed with
|
---|
61 | <command>java HelloWorld</command>. This creates a JVM and runs the
|
---|
62 | code. The 'class' extension must not be specified.
|
---|
63 | </para>
|
---|
64 |
|
---|
65 | <para>
|
---|
66 | Several class files can be combined into one file with the
|
---|
67 | <command>jar</command> command. This is similar to the standard
|
---|
68 | <command>tar</command> command. For instance, the command
|
---|
69 | <command>jar cf myjar.jar *.class</command> will combine all class files
|
---|
70 | in a directory into one jar file. These act as library files.
|
---|
71 | </para>
|
---|
72 |
|
---|
73 | <para>
|
---|
74 | The JVM can search for and use classes in jar files automatically.
|
---|
75 | It uses the <envar>CLASSPATH</envar> environment variable to search for
|
---|
76 | jar files. This is a standard list of colon-separated directory names
|
---|
77 | similar to the <envar>PATH</envar> environment variable.
|
---|
78 | </para>
|
---|
79 |
|
---|
80 | </sect2>
|
---|
81 |
|
---|
82 | <sect2 id="java-bin" xreflabel="Java Binary" role="package">
|
---|
83 | <title>Binary JDK Information</title>
|
---|
84 |
|
---|
85 | <para>
|
---|
86 | Creating a JVM from source requires a set of circular dependencies.
|
---|
87 | The first thing that's needed is a set of programs called a Java
|
---|
88 | Development Kit (JDK). This set of programs includes
|
---|
89 | <command>java</command>, <command>javac</command>,
|
---|
90 | <command>jar</command>, and several others. It also includes several
|
---|
91 | base <emphasis>jar</emphasis> files.
|
---|
92 | </para>
|
---|
93 |
|
---|
94 | <para>
|
---|
95 | To start, we set up a binary installation of the JDK created
|
---|
96 | by the BLFS editors. It is installed in the <filename>/opt</filename>
|
---|
97 | directory to allow for multiple installations, including a source based
|
---|
98 | version.
|
---|
99 | </para>
|
---|
100 |
|
---|
101 | &lfs91_checked;
|
---|
102 |
|
---|
103 | <bridgehead renderas="sect3">Binary Package Information</bridgehead>
|
---|
104 | <itemizedlist spacing="compact">
|
---|
105 | <listitem>
|
---|
106 | <para>
|
---|
107 | Binary download (x86): <ulink url="&openjdk-download-binary-x86;"/>
|
---|
108 | </para>
|
---|
109 | </listitem>
|
---|
110 | <listitem>
|
---|
111 | <para>
|
---|
112 | Download MD5 sum: &openjdk-bin-md5sum-x86;
|
---|
113 | </para>
|
---|
114 | </listitem>
|
---|
115 | <listitem>
|
---|
116 | <para>
|
---|
117 | Download size (binary): &openjdk-bin-size-x86;
|
---|
118 | </para>
|
---|
119 | </listitem>
|
---|
120 | <listitem>
|
---|
121 | <para>
|
---|
122 | Estimated disk space required: &openjdk-bin-buildsize-x86;
|
---|
123 | </para>
|
---|
124 | </listitem>
|
---|
125 | </itemizedlist>
|
---|
126 | <itemizedlist spacing="compact">
|
---|
127 | <listitem>
|
---|
128 | <para>
|
---|
129 | Binary download (x86_64): <ulink url="&openjdk-download-binary-x64;"/>
|
---|
130 | </para>
|
---|
131 | </listitem>
|
---|
132 | <listitem>
|
---|
133 | <para>
|
---|
134 | Download MD5 sum: &openjdk-bin-md5sum-x64;
|
---|
135 | </para>
|
---|
136 | </listitem>
|
---|
137 | <listitem>
|
---|
138 | <para>
|
---|
139 | Download size (binary): &openjdk-bin-size-x64;
|
---|
140 | </para>
|
---|
141 | </listitem>
|
---|
142 | <listitem>
|
---|
143 | <para>
|
---|
144 | Estimated disk space required: &openjdk-bin-buildsize-x64;
|
---|
145 | </para>
|
---|
146 | </listitem>
|
---|
147 | </itemizedlist>
|
---|
148 |
|
---|
149 | <bridgehead renderas="sect3">Java Binary Runtime Dependencies</bridgehead>
|
---|
150 | <para role="required">
|
---|
151 | <xref role="runtime" linkend="alsa-lib"/>,
|
---|
152 | <xref role="runtime" linkend="cups"/>,
|
---|
153 | <xref role="runtime" linkend="giflib"/>, and
|
---|
154 | <xref role="runtime" linkend="xorg7-lib"/>
|
---|
155 | </para>
|
---|
156 |
|
---|
157 | </sect2>
|
---|
158 |
|
---|
159 | <sect2 role="installation">
|
---|
160 | <title>Installation of the Java BinaryJDK </title>
|
---|
161 | <para>
|
---|
162 | Begin by extracting the appropriate binary tarball for your
|
---|
163 | architecture and changing to the extracted directory. Install the binary
|
---|
164 | <application>OpenJDK</application> with the following commands as the
|
---|
165 | <systemitem class="username">root</systemitem> user:
|
---|
166 | </para>
|
---|
167 |
|
---|
168 | <screen role="root"><userinput>install -vdm755 /opt/OpenJDK-&openjdk-version;+&openjdk-build;-bin &&
|
---|
169 | mv -v * /opt/OpenJDK-&openjdk-version;+&openjdk-build;-bin &&
|
---|
170 | chown -R root:root /opt/OpenJDK-&openjdk-version;+&openjdk-build;-bin</userinput></screen>
|
---|
171 |
|
---|
172 | <para>
|
---|
173 | The binary version is now installed. You may create a symlink to that
|
---|
174 | version by issuing, as the <systemitem class="username">root</systemitem>
|
---|
175 | user:
|
---|
176 | </para>
|
---|
177 |
|
---|
178 | <screen role="root"><userinput>ln -sfn OpenJDK-&openjdk-version;+&openjdk-build;-bin /opt/jdk</userinput></screen>
|
---|
179 |
|
---|
180 | <para>
|
---|
181 | You may now proceed to <xref linkend="ojdk-conf"/>, where the
|
---|
182 | instructions assume that the above link exists.
|
---|
183 | </para>
|
---|
184 |
|
---|
185 | </sect2>
|
---|
186 |
|
---|
187 | </sect1>
|
---|