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