source: general/prog/java.xml@ 3cd08693

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 3cd08693 was 3cd08693, checked in by Bruce Dubbs <bdubbs@…>, 10 years ago

Add Java binary runtime dependencies.
Add some more tags

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@12759 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 "http://anduin.linuxfromscratch.org/files/BLFS/OpenJDK-&openjdk-version;">
8 <!ENTITY openjdk-download-binary-x86 "&anduin-download;/OpenJDK-&openjdk-version;-i686-bin.tar.xz">
9 <!ENTITY openjdk-bin-md5sum-x86 "c4a5097fe08dc95defa65d1eb072752f">
10 <!ENTITY openjdk-bin-size-x86 "174 MB">
11 <!ENTITY openjdk-bin-buildsize-x86 "547 MB">
12
13 <!ENTITY openjdk-download-binary-x64 "&anduin-download;/OpenJDK-&openjdk-version;-x86_64-bin.tar.xz">
14 <!ENTITY openjdk-bin-md5sum-x64 "cbd28cd7f89dadb6534b87ed712aedea">
15 <!ENTITY openjdk-bin-size-x64 "146 MB">
16 <!ENTITY openjdk-bin-buildsize-x64 "424 MB">
17]>
18
19<sect1 id="java">
20 <?dbhtml filename="java.html"?>
21
22 <sect1info>
23 <othername>$LastChangedBy$</othername>
24 <date>$Date$</date>
25 </sect1info>
26
27 <title>About Java</title>
28
29 <indexterm zone="java">
30 <primary sortas="a-java">JDK Binary</primary>
31 </indexterm>
32
33
34 <para>Java is different from most of the packages in LFS and BLFS. It
35 is a programming language that works with files of byte codes to obtain
36 instructions and executes then in a Java Virtual Machine (JVM). An
37 introductory java program looks like:</para>
38
39<screen><literal>public class HelloWorld
40{
41 public static void main(String[] args)
42 {
43 System.out.println("Hello, World");
44 }
45}</literal></screen>
46
47 <para>This program is saved as <filename>HelloWorld.java</filename>. The file
48 name, <emphasis>HelloWorld</emphasis>, must match the class name. It
49 is then converted into byte code with <command>javac HelloWorld.java</command>.
50 The output file is <filename>HelloWorld.class</filename>. The program is
51 executed with <command>java HelloWorld</command>. This creates a JVM and
52 runs the code. The 'class' extension must not be specified.</para>
53
54 <para>Several class files can be combined into one file with the
55 <command>jar</command> command. This is similar to the standard
56 <command>tar</command> command. For instance, the command <command>jar cf myjar.jar
57 *.class</command> will combine all class files in a directory into one jar
58 file. These act as library files.</para>
59
60 <para>The JVM can search for and use classes in jar files automatically. It
61 uses the <envar>CLASSPATH</envar> environment variable to search for jar files.
62 This is a standard list of colon-separated directory names similar to
63 the <envar>PATH</envar> environment variable.</para>
64
65 &lfs74_checked;
66
67 <sect2 id="java-bin" xreflabel="Java Binary">
68 <title>Installing a binary JDK</title>
69
70 <para>Creating a JVM from source requires a set of circular dependencies.
71 The first thing that's needed is a set of programs called a Java Development
72 Kit (JDK). This set of programs includes <command>java</command>,
73 <command>javac</command>, <command>jar</command>, and several others. It
74 also includes several base <emphasis>jar</emphasis> files.</para>
75
76 <para>To start, we set up a binary installation of the JDK created
77 by the BLFS editors. It is installed in the <filename>/opt</filename>
78 directory to allow for multiple installations, including a source based
79 version.</para>
80
81 <bridgehead renderas="sect3">Binary Package Information</bridgehead>
82 <itemizedlist spacing="compact">
83 <listitem>
84 <para>Binary download (x86):
85 <ulink url="&openjdk-download-binary-x86;"/></para>
86 </listitem>
87 <listitem>
88 <para>Download MD5 sum: &openjdk-bin-md5sum-x86;</para>
89 </listitem>
90 <listitem>
91 <para>Download size (binary): &openjdk-bin-size-x86;</para>
92 </listitem>
93 <listitem>
94 <para>Estimated disk space required: &openjdk-bin-buildsize-x86;</para>
95 </listitem>
96 </itemizedlist>
97 <itemizedlist spacing="compact">
98 <listitem>
99 <para>Binary download (x86_64):
100 <ulink url="&openjdk-download-binary-x64;"/></para>
101 </listitem>
102 <listitem>
103 <para>Download MD5 sum: &openjdk-bin-md5sum-x64;</para>
104 </listitem>
105 <listitem>
106 <para>Download size (binary): &openjdk-bin-size-x64;</para>
107 </listitem>
108 <listitem>
109 <para>Estimated disk space required: &openjdk-bin-buildsize-x64;</para>
110 </listitem>
111 </itemizedlist>
112
113 <bridgehead renderas="sect3">Java Binary Runtime Dependencies</bridgehead>
114 <para role="required">
115 <xref linkend="atk"/>,
116 <xref linkend="cairo"/>,
117 <xref linkend="cups"/>,
118 <xref linkend="gdk-pixbuf"/>,
119 <xref linkend="giflib"/>,
120 <xref linkend="gtk2"/>,
121 <xref linkend="lcms2"/>,
122 <xref linkend="pulseaudio"/>, and
123 <xref linkend="xorg7-lib"/>
124 </para>
125
126 <para>Begin by extracting the appropriate binary tarball for your
127 architecture and changing to the extracted directory. Install the binary
128 <application>OpenJDK</application> with the following commands as the
129 <systemitem class="username">root</systemitem> user:</para>
130
131<screen role="root"><userinput>install -vdm755 /opt/OpenJDK-&openjdk-version;-bin &amp;&amp;
132mv -v * /opt/OpenJDK-&openjdk-version;-bin &amp;&amp;
133chown -R root:root /opt/OpenJDK-&openjdk-version;-bin</userinput></screen>
134
135 <para>Configure the temporary <application>OpenJDK</application>
136 installation with the following commands:</para>
137
138<screen><userinput>export CLASSPATH=.:/usr/share/java &amp;&amp;
139export PATH="$PATH:/opt/OpenJDK-&openjdk-version;-bin/bin"</userinput></screen>
140
141 <para>The binary version is now installed. If you don't want to compile the
142 sources, skip ahead to the <xref linkend='openjdk-config'/> section.
143 Otherwise, continue to the <xref linkend='junit'/>, <xref
144 linkend='apache-ant'/>, and <xref linkend='openjdk'/> sections.</para>
145
146 </sect2>
147
148</sect1>
Note: See TracBrowser for help on using the repository browser.