source: general/prog/java.xml@ 572553b

10.0 10.1 11.0 11.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind lazarus perl-modules qt5new trunk upgradedb xry111/intltool xry111/test-20220226
Last change on this file since 572553b was 572553b, checked in by Pierre Labastie <pieere@…>, 5 years ago

role="runtime|nodep" in general

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@19231 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 5.9 KB
Line 
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 "08ea7bd6d308382d9fb605ffe1599d15">
10 <!ENTITY openjdk-bin-size-x86 "57 MB">
11 <!ENTITY openjdk-bin-buildsize-x86 "167 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 "e924a6923dc156e9f65ca53fffcdcf30">
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 &lfs81_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 role="runtime" linkend="alsa-lib"/>,
122 <xref role="runtime" linkend="cups"/>,
123 <xref role="runtime" linkend="giflib"/>, and
124 <xref role="runtime" 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 &amp;&amp;
137mv -v * /opt/OpenJDK-&openjdk-version;-bin &amp;&amp;
138chown -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>
Note: See TracBrowser for help on using the repository browser.