source: general/prog/j2sdk.xml@ 97b53b5

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 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 97b53b5 was 97b53b5, checked in by Randy McMurchy <randy@…>, 19 years ago

Added index tags to the ASH instructions; updated template

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

  • Property mode set to 100644
File size: 16.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY j2sdk-download-http "http://freshmeat.net/projects/sunjdk">
8 <!ENTITY j2sdk-download-ftp " ">
9 <!ENTITY j2sdk-bin-size "35 MB">
10 <!ENTITY j2sdk-src-size "77 MB">
11 <!ENTITY j2sdk-src-buildsize "1810 MB">
12 <!ENTITY j2sdk-time "85 SBU">
13]>
14
15<sect1 id="j2sdk" xreflabel="J2SDK-&j2sdk-src-version;">
16<sect1info>
17<othername>$LastChangedBy$</othername>
18<date>$Date$</date>
19</sect1info>
20<?dbhtml filename="j2sdk.html" ?>
21<title>J2SDK-&j2sdk-src-version;</title>
22
23<sect2>
24<title>Introduction to j2sdk</title>
25
26<para>The <application>J2SDK</application> package contains Sun's
27<application>Java</application> development environment. This is useful for
28developing <application>Java</application> programs and provides the runtime
29environment necessary to run <application>Java</application> programs. It also
30includes a plug-in for browsers so that they can be <application>Java
31</application> aware.</para>
32
33<para>
34The <acronym>JDK</acronym> comes in two flavors, a precompiled binary and a
35source package. Previously, the plugin included in the <acronym>JDK</acronym> binary
36package was unusable on <acronym>LFS</acronym>
37owing to incompatibilities with <acronym>GCC</acronym>-3 compiled browsers.
38This is not the case anymore.</para>
39
40<para>The source package requires registration at the Sun
41developer site and accepting the Sun Community Source License.
42The source code cannot be downloaded from some countries, so for users
43from those countries, the binary may be the only option.</para>
44
45<para>Even if you plan on compiling the <acronym>JDK</acronym> source, you will
46need to download the binary version to bootstrap the <acronym>JDK</acronym>
47build. Follow the link below to download both source and binary packages. When
48downloading the source also download the <application>Mozilla</application>
49headers package available at the same location.</para>
50
51<!--
52<para>For users who cannot download the <application>J2SDK</application>
53source owing to license restrictions, <application>blackdown
54</application> has an <acronym>GCC</acronym>-3 based precompiled version.
55Check out <ulink url="http://www.blackdown.org/"/> for more
56information.</para>
57-->
58
59<sect3><title>Package information</title>
60<itemizedlist spacing='compact'>
61<listitem><para>Download (HTTP): <ulink
62url="&j2sdk-download-http;"/></para></listitem>
63
64<!--
65<listitem><para>Download (FTP): <ulink
66url="&j2sdk-download-ftp;"/></para></listitem>
67-->
68<listitem><para>Version used (binary):
69&j2sdk-bin-version;</para></listitem>
70<listitem><para>Download size (binary): &j2sdk-bin-size;</para></listitem>
71<listitem><para>Download size (source): &j2sdk-src-size;</para></listitem>
72<listitem><para>Estimated disk space required:
73&j2sdk-src-buildsize;</para></listitem>
74<listitem><para>Estimated build time:
75&j2sdk-time;</para></listitem></itemizedlist>
76</sect3>
77
78<sect3><title>Additional downloads</title>
79<itemizedlist spacing='compact'>
80<listitem><para><ulink url="&patch-root;/j2sdk-&j2sdk-src-version;-fix_inline_asm-1.patch"/></para></listitem>
81<listitem><para><ulink url="&patch-root;/j2sdk-&j2sdk-src-version;-gcc33-1.patch"/></para></listitem>
82<listitem><para><ulink url="&patch-root;/j2sdk-&j2sdk-src-version;-motif_mkmsgcat-1.patch"/></para></listitem>
83<listitem><para><ulink url="&patch-root;/j2sdk-&j2sdk-src-version;-nptl-1.patch"/></para></listitem>
84<listitem><para><ulink url="&patch-root;/j2sdk-&j2sdk-src-version;-remove_debug_image-1.patch"/></para></listitem>
85<listitem><para><ulink url="&patch-root;/j2sdk-&j2sdk-src-version;-remove_fixed_paths-1.patch"/></para></listitem>
86<listitem><para><ulink url="&patch-root;/j2sdk-&j2sdk-src-version;-static_cxx-1.patch"/></para></listitem>
87<listitem><para><ulink url="&patch-root;/j2sdk-&j2sdk-src-version;-ash-1.patch"/>
88(Only required if /bin/sh is symlinked to <xref linkend="ash-package"/>)</para></listitem>
89</itemizedlist>
90</sect3>
91
92<sect3><title><application>J2SDK</application> dependencies</title>
93<sect4><title>Required</title>
94<para>X (<xref linkend="xfree86"/> or <xref linkend="xorg"/>),
95<xref linkend="zip"/>, <xref linkend="unzip"/>, <xref linkend="cpio"/>,
96<xref linkend="alsa"/>, <xref linkend="tcsh"/> and <xref linkend="gcc3"/>
97</para></sect4>
98</sect3>
99
100</sect2>
101
102<sect2>
103<title>Installation of <application>J2SDK</application></title>
104
105<para>Both versions will be installed in parallel. You may choose to keep
106either or both.</para>
107
108<para>Installation of the precompiled <acronym>JDK</acronym> is easy:
109create a directory to install from, copy the .bin there, and run the
110following commands:</para>
111
112<screen><userinput><command>VERSION=&j2sdk-bin-version; &amp;&amp;
113MV=`echo $VERSION | cut -d "_" -f 1,1` &amp;&amp;
114V=`echo ${VERSION} | sed -e "s/\./_/g"` &amp;&amp;
115sed -i "s:^PATH=.*::" j2sdk-${V}-linux-i?86.bin &amp;&amp;
116chmod +x j2sdk-${V}-linux-i?86.bin &amp;&amp;
117mkdir -p bin &amp;&amp;
118ln -sf /bin/true bin/more &amp;&amp;
119yes | PATH=$PWD/bin:$PATH ./j2sdk-${V}-linux-i?86.bin &amp;&amp;
120cd j2sdk${VERSION} &amp;&amp;
121install -d /opt/j2sdk/j2sdk-precompiled-${MV} &amp;&amp;
122mv * /opt/j2sdk/j2sdk-precompiled-${MV}</command></userinput></screen>
123
124<para>The binary version is now installed.</para>
125
126<para>If you don't want to compile the source or are not in a position to
127download the source owing to license restrictions, skip ahead to the
128configuration section.</para>
129
130<para>Add the recently installed <acronym>JDK</acronym> to the path.</para>
131
132<screen><userinput><command>export JAVA_HOME=/opt/j2sdk/j2sdk-precompiled-${MV} &amp;&amp;
133export PATH=$PATH:${JAVA_HOME}/bin</command></userinput></screen>
134
135<para>Unzip the source:</para>
136
137<screen><userinput><command>mkdir j2sdk-build &amp;&amp;
138cd j2sdk-build &amp;&amp;
139VERSION=&j2sdk-src-version; &amp;&amp;
140V=`echo $VERSION | sed -e "s/\./_/g"` &amp;&amp;
141unzip ../j2sdk-${V}-src-scsl.zip &amp;&amp;
142unzip ../j2sdk-${V}-mozilla_headers-unix.zip &amp;&amp;
143unzip ../j2sdk-${V}-bin-scsl.zip</command></userinput></screen>
144
145<para>Apply all the patches downloaded above.</para>
146
147<screen><userinput><command>for PATCH in ../j2skd-&j2sdk-src-version;*.patch
148do
149 patch -Np1 -i $PATCH
150done</command></userinput></screen>
151
152<para>Set/unset some variables which affect the build:</para>
153<screen><userinput><command>export ALT_BOOTDIR="$JAVA_HOME" &amp;&amp;
154unset JAVA_HOME &amp;&amp;
155unset CLASSPATH
156unset CFLAGS
157unset CXXFLAGS
158unset LDFLAGS
159export ALT_DEVTOOLS_PATH="/usr/bin" &amp;&amp;
160export BUILD_NUMBER="blfs-`date +%s`" &amp;&amp;
161export DEV_ONLY=true &amp;&amp;
162export ALT_MOZILLA_PATH=$PWD &amp;&amp;
163export INSANE=true &amp;&amp;
164export MAKE_VERBOSE=true &amp;&amp;
165export ALT_CACERTS_FILE=${ALT_BOOTDIR}/jre/lib/security/cacerts
166export PATH_HOLD=$PATH
167export PATH=/opt/gcc-&gcc3-version;/bin:$PATH</command></userinput></screen>
168
169<warning><para>Setting CFLAGS/CXXFLAGS/LDFLAGS is guaranteed to make the build
170fail. If you are interested in optimizing the build, set
171OTHER_CFLAGS/OTHER_CXXFLAGS/OTHER_LDFLAGS instead.</para></warning>
172
173<para>Additionally, if you would like to make in parallel, add the following
174(adjust <envar>MAKE_PARALLEL</envar> to your liking):</para>
175<screen><userinput><command>export HOTSPOT_BUILD_JOBS=$MAKE_PARALLEL</command></userinput></screen>
176
177<para>If the included <application>Motif</application> doesn't build properly,
178the error is noticed much later in the build. A solution is to build the
179<application>Motif</application> library before compiling the
180<application>J2SDK</application>.</para>
181
182<screen><userinput><command>cd motif/lib/Xm &amp;&amp;
183make &amp;&amp;
184cd ../../..</command></userinput></screen>
185
186<para>Make and Install <application>J2SDK</application> with the following
187commands. There will be a lot of messages about missing files that look like
188errors. As long as the build doesn't stop, the messages are harmless, so ignore
189them.</para>
190
191<screen><userinput><command>cd control/make &amp;&amp;
192make &amp;&amp;
193cd ../.. &amp;&amp;
194cd control/build/linux-i?86 &amp;&amp;
195cp -a j2sdk-image /opt/j2sdk/j2sdk-&j2sdk-src-version; &amp;&amp;
196export PATH=$PATH_HOLD</command></userinput></screen>
197
198</sect2>
199
200<sect2>
201<title>Command explanations</title>
202
203<para><command>export ALT_BOOTDIR="$JAVA_HOME"</command>: This var sets
204location of the bootstrap <acronym>JDK</acronym>.</para>
205
206<para><command>export ALT_MOZILLA_PATH=$PWD</command>: This sets the
207variable that points to where you unzipped the <application>Mozilla
208</application> headers.</para>
209
210<para><command>export ALT_DEVTOOLS_PATH="/usr/bin"</command>: This
211changes the location where the build finds the needed executables.</para>
212
213<para><command>export BUILD_NUMBER="blfs-`date +%s`"</command>: This will
214help you identify this compiled version of the runtime environment and
215virtual machine by appending this information to the version in the
216output to <command>java -version</command>.</para>
217
218<para><command>export DEV_ONLY=true</command>: This command
219eliminates compiling the documentation and eliminates a dependency for
220<application>rpm</application>.</para>
221
222<para><command>unset JAVA_HOME</command>: This clears the
223<envar>JAVA_HOME</envar> variable as recommended by the build
224instructions.</para>
225
226<para><command>unset CLASSPATH</command>: This clears the
227<envar>CLASSPATH</envar> variable as per the recommendations in the build
228instructions.</para>
229
230<para><command>unset CFLAGS...</command>: These flags cause miscompilation
231of the build. Never set these.</para>
232
233<para><command>export INSANE=true</command>: Unless you specify that you
234are insane the build will not proceed. The certified platform for the build is
235Redhat 6.1. The above variable ensures that all the errors related to
236compiling on a non-certified platform will be converted to warnings.</para>
237
238<para><command>export MAKE_VERBOSE=true</command>: Allows the current
239compilation command to be displayed on the console.</para>
240
241<para><command>export ALT_CACERTS_FILE...</command>: Specifies the
242certificate file to use.</para>
243
244</sect2>
245
246<sect2>
247<title>Configuring <application>J2SDK</application></title>
248
249<sect3><title>Configuration Information</title>
250
251<para>There are now two Java 2 <acronym>SDK</acronym>'s installed in
252<filename>/opt/j2sdk</filename>. You should decide on which one you
253would like to use as the default. For example if you decide to use the source
254compiled <application>J2SDK</application>, do the following:</para>
255
256<screen><userinput><command>ln -nsf j2sdk-&j2sdk-src-version; /opt/j2sdk/j2sdk</command></userinput></screen>
257
258<para>Add the following lines to your shell startup file (e.g.,
259<filename>/etc/profile</filename>).</para>
260
261<screen><userinput>export JAVA_HOME=/opt/j2sdk/j2sdk
262export PATH=$PATH:$JAVA_HOME/bin</userinput></screen>
263
264<para>Add <filename>$JAVA_HOME/man</filename> to your
265<envar>MANPATH</envar> variable or to
266<filename>/etc/man.conf</filename></para>
267
268<para>The <application>Java</application> plugin is in the directory
269<filename class="directory">$JAVA_HOME/jre/plugin/i?86/ns610/</filename>.
270Make a symbolic link to the file in that directory from your plugins directory.
271Note that the plugin must be a symlink for it to work. If not, the browsers
272just crash when you attempt to load a Java plugin.</para>
273
274</sect3>
275
276<sect3><title>Handling CLASSPATH</title>
277
278<para>When compiling packages, the <envar>CLASSPATH</envar> environment variable
279is used by JDK to locate classes at compile-time and run-time. It is tedious to
280add all the classes used to the <envar>CLASSPATH</envar> manually. You may add
281the following lines to your shell startup file to set <envar>CLASSPATH</envar>
282automatically to include all JAR files in a specified directory, which in
283the example below is <filename>/usr/lib/auto-java-classpath</filename>.</para>
284
285<screen><userinput>AUTO_CLASSPATH_DIR=/usr/lib/auto-java-classpath
286if [ -z $CLASSPATH ]
287then
288 CLASSPATH=.:$AUTO_CLASSPATH_DIR
289else
290 CLASSPATH=$CLASSPATH:.:$AUTO_CLASSPATH_DIR
291fi
292for i in $(ls $AUTO_CLASSPATH_DIR/*.jar 2>/dev/null)
293do
294 CLASSPATH=$CLASSPATH:$i
295done</userinput></screen>
296
297</sect3>
298
299</sect2>
300
301<sect2>
302<title>Contents</title>
303
304<para>The <application>J2SDK</application> package contains
305<command>appletviewer</command>,
306<command>extcheck</command>, <command>idlj</command>,
307<command>jar</command>, <command>jarsigner</command>,
308<command>java</command>, <command>javac</command>,
309<command>javadoc</command>, <command>javah</command>,
310<command>javap</command>, <command>jdb</command>,
311<command>keytool</command>, <command>native2ascii</command>,
312<command>orbd</command>, <command>policytool</command>,
313<command>rmic</command>, <command>rmid</command>,
314<command>rmiregistry</command>, <command>rmiregistry</command>,
315<command>serialver</command>, <command>servertool</command> and
316<command>tnameserv</command>.</para>
317
318</sect2>
319
320<sect2><title>Description</title>
321
322<sect3><title>appletviewer</title>
323<para><command>appletviewer</command> runs <application>Java</application>
324applets outside of the context of a browser.</para></sect3>
325
326<sect3><title>extcheck</title>
327<para><command>extcheck</command> checks a specified <filename>JAR</filename>
328file for title and version conflicts with any extensions installed in the
329<acronym>JDK</acronym> software.</para></sect3>
330
331<sect3><title>idlj</title>
332<para><command>idlj</command> generates <application>Java</application>
333bindings from a given <acronym>IDL</acronym> file.</para></sect3>
334
335<sect3><title>jar</title>
336<para><command>jar</command> combines multiple files into a single
337<acronym>JAR</acronym> archive file.</para></sect3>
338
339<sect3><title>jarsigner</title>
340<para><command>jarsigner</command> signs <filename>JAR</filename>
341(Java ARchive) files and verifies the signatures and integrity of a signed
342<filename>JAR</filename>.</para></sect3>
343
344<sect3><title>java</title>
345<para><command>java</command> launches a <application>Java</application>
346application by starting a <application>Java</application> runtime
347environment, loading a specified class and invoking its main
348method.</para></sect3>
349
350<sect3><title>javac</title>
351<para><command>javac</command> reads class and interface definitions, written
352in the <application>Java</application> programming language, and compiles them
353into bytecode class files.</para></sect3>
354
355<sect3><title>javadoc</title>
356<para><command>javadoc</command> parses the declarations and documentation
357comments in a set of <application>Java</application> source files and produces
358a corresponding set of <acronym>HTML</acronym> pages describing the classes,
359interfaces, constructors, methods, and fields.</para></sect3>
360
361<sect3><title>javah</title>
362<para><command>javah</command> generates <application>C</application> header
363and source files that are needed to implement native methods.</para></sect3>
364
365<sect3><title>javap</title>
366<para><command>javap</command> disassembles a
367<application>Java</application> class file.</para></sect3>
368
369<sect3><title>jdb</title>
370<para><command>jdb</command> is a simple command-line debugger for
371<application>Java</application> classes.</para></sect3>
372
373<sect3><title>keytool</title>
374<para><command>keytool</command> is a key and certificate management
375utility.</para></sect3>
376
377<sect3><title>native2ascii</title>
378<para><command>native2ascii</command> converts files that contain non-supported
379character encoding into files containing Latin-1 or Unicode-encoded
380characters.</para></sect3>
381
382<sect3><title>orbd</title>
383<para><command>orbd</command> is used to enable clients to transparently locate
384and invoke persistent objects on servers in the <acronym>CORBA</acronym>
385environment.</para></sect3>
386
387<sect3><title>policytool</title>
388<para><command>policytool</command> creates and manages a policy file
389graphically.</para></sect3>
390
391<sect3><title>rmic</title>
392<para><command>rmic</command> generates stub and skeleton class files for
393remote objects from the names of compiled <application>Java</application>
394classes that contain remote object implementations.</para></sect3>
395
396<sect3><title>rmid</title>
397<para><command>rmid</command> starts the activation system daemon.</para>
398</sect3>
399
400<sect3><title>rmiregistry</title>
401<para><command>rmiregistry</command> creates and starts a remote object
402registry on the specified port on the current host.</para></sect3>
403
404<sect3><title>serialver</title>
405<para><command>serialver</command> returns the serialVersionUID for one or
406more classes in a form suitable for copying into an evolving class.</para>
407</sect3>
408
409<sect3><title>servertool</title>
410<para><command>servertool</command> provides an ease-of-use interface for
411application programmers to register, unregister, startup and shutdown a
412server.</para></sect3>
413
414<sect3><title>tnameserv</title>
415<para><command>tnameserv</command> starts the <application>Java</application>
416<acronym>IDL</acronym> name server.</para></sect3>
417
418</sect2>
419
420</sect1>
421
Note: See TracBrowser for help on using the repository browser.