source: general/prog/java.xml

trunk
Last change on this file was f722f5b, checked in by Bruce Dubbs <bdubbs@…>, 2 months ago

Tag the rest of Chapter 13 minus openjdk plus apache

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