source: general/prog/openjdk.xml@ 870e4acf

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 870e4acf was 870e4acf, checked in by Pierre Labastie <pieere@…>, 10 years ago

Patch icedtea for using the new giflib API

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

  • Property mode set to 100644
File size: 44.7 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 icedtea-download "http://icedtea.classpath.org/download/source/icedtea-&icedtea-version;.tar.xz">
9
10 <!ENTITY icedtea-md5sum "f6b28633b9978fadc724247cfc264ff0">
11 <!ENTITY icedtea-size "3.3 MB">
12
13 <!ENTITY corba-download "&anduin-download;/corba.tar.gz">
14 <!ENTITY corba-md5sum "0a8f2235307b68553865ac38192690c7">
15 <!ENTITY corba-size "1.4 MB">
16
17 <!ENTITY hotspot-download "&anduin-download;/hotspot.tar.gz">
18 <!ENTITY hotspot-md5sum "0381ef3920f1ff5c8ac6c8860974d8cc">
19 <!ENTITY hotspot-size "9.3 MB">
20
21 <!ENTITY jaxp-download "&anduin-download;/jaxp.tar.gz">
22 <!ENTITY jaxp-md5sum "ba7a21a3ef2ce5d0d47c7015e43c5dcf">
23 <!ENTITY jaxp-size "3.7 MB">
24
25 <!ENTITY jaxws-download "&anduin-download;/jaxws.tar.gz">
26 <!ENTITY jaxws-md5sum "9ef2ea5b1e87777c75a72e1dca6fab1d">
27 <!ENTITY jaxws-size "2.6 MB">
28
29 <!ENTITY jdk-download "&anduin-download;/jdk.tar.gz">
30 <!ENTITY jdk-md5sum "cea74e96852bf017f73222fa7045daee">
31 <!ENTITY jdk-size "38.1 MB">
32
33 <!ENTITY langtools-download "&anduin-download;/langtools.tar.gz">
34 <!ENTITY langtools-md5sum "449cec19b80ab70935d02d03e3cbc568">
35 <!ENTITY langtools-size "2.2 MB">
36
37 <!ENTITY openjdk-download "&anduin-download;/openjdk.tar.gz">
38 <!ENTITY openjdk-md5sum "b0295fd54825d3f47d47de81d81a475a">
39 <!ENTITY openjdk-size "135 KB">
40
41 <!ENTITY rhino-download "https://github.com/downloads/mozilla/rhino/rhino1_7R4.zip">
42 <!ENTITY rhino-md5sum "ad67a3dff135e3a70f0c3528a2d6edf2">
43 <!ENTITY rhino-size "6.2 MB">
44
45 <!ENTITY openjdk-buildsize "8.5-11 GB">
46 <!ENTITY openjdk-time "34-37 SBU (an additional 100 SBU for testsuite)">
47]>
48
49<sect1 id="openjdk" xreflabel="OpenJDK-&openjdk-version;/IcedTea-&icedtea-version;">
50 <?dbhtml filename="openjdk.html" ?>
51
52 <sect1info>
53 <othername>$LastChangedBy$</othername>
54 <date>$Date$</date>
55 </sect1info>
56
57 <title>OpenJDK-&openjdk-version;/IcedTea-&icedtea-version;</title>
58
59 <indexterm zone="openjdk">
60 <primary sortas="a-OpenJDK">OpenJDK</primary>
61 </indexterm>
62
63 <sect2 role="package">
64 <title>Introduction to OpenJDK and IcedTea</title>
65
66 <para><application>IcedTea</application> provides a build harness for the
67 <application>OpenJDK</application> package, Oracle's open-sourced
68 <application>Java</application> development environment. In order to
69 provide a completely free runtime environment, similar to Oracle's closed
70 distribution, the <application>IcedTea</application> build harness also
71 provides free, and arguably better versions of parts of the JDK which
72 have not been open-sourced to date. <application>OpenJDK</application> is
73 useful for developing <application>Java</application> programs and provides
74 a complete runtime environment to run <application>Java</application>
75 programs.</para>
76
77 &lfs75_checked;
78
79 <note><para>The browser plugin and webstart implementation have been split
80 off into a separate project. To provide a complete implementation, you will
81 need to later install <xref linkend="icedtea-web"/>.</para></note>
82
83 <para>OpenJDK is GPL'd code, however, it should be explained that there has
84 been a special exception made for non-free projects to use these classes in
85 their proprietary products. In similar fashion to the LGPL, which
86 allows non-free programs to link to libraries provided by free software,
87 the <ulink url="http://openjdk.java.net/legal/gplv2+ce.html">GNU
88 General Public License, version 2, with the Classpath Exception</ulink>
89 allows third party programs to use classes provided by free software
90 without the requirement that the third party software also be free. As with
91 the LGPL, any modifications made to the free software portions of a
92 third party application, must also be made freely available.</para>
93
94 <note>
95 <para>The IcedTea build environment includes a very thorough, open source
96 test suite titled <application>JTreg</application>.
97 <application>JTreg</application> is intended to test the just built JDK
98 for reasonable compatibility with the closed Oracle JDK. However, in
99 order for an independent implementation to claim compatibility, including
100 the Oracle sponsored <application>OpenJDK</application> project, it must
101 pass a closed <application>JCK/TCK</application> test suite. No claims
102 of compatibility, even partial compatibility, may be made without
103 passing an approved test suite.</para>
104
105 <para>Oracle does provide free community access, on a case by case basis,
106 to a closed toolkit to ensure 100% compatibility with its proprietary JDK.
107 The binary version provided here has not been tested against the
108 <ulink url="http://openjdk.java.net/groups/conformance/JckAccess/jck-access.html">
109 TCK</ulink>. Any version that is built using the instructions given,
110 cannot claim to be compatible with the proprietary JDK, without the user
111 applying for, and completing the compatibility tests themselves.</para>
112
113 <para>With that in mind, the binaries produced using this build method are
114 regularly tested against the TCK by the members listed on the site above.
115 In addition to the community license above, an educational, non-commercial
116 license for the TCK can be obtained from
117 <ulink url="http://www.oracle.com/technetwork/java/index-137188.html">
118 here</ulink>.</para>
119 </note>
120
121 <bridgehead renderas="sect3">Source Package Information</bridgehead>
122 <itemizedlist spacing="compact">
123 <listitem>
124 <para>IcedTea Source Package
125 <simplelist>
126 <member>Download: <ulink url="&icedtea-download;"/></member>
127 <member>Download MD5 sum: &icedtea-md5sum;</member>
128 <member>Download Size: &icedtea-size;</member>
129 </simplelist>
130 </para>
131 </listitem>
132 </itemizedlist>
133
134 <para>The following may be downladed separately or be done as a
135 part of the <command>make</command> process. For convenience
136 the BLFS editors have made the files available in an LFS website.
137 The files are not distributed with versions, but extracted from
138 the OpenJDK version control system at specified (tagged) points.</para>
139
140 <itemizedlist spacing="compact">
141 <listitem>
142 <para>Corba Source
143 <simplelist>
144 <member>Download: <ulink url="&corba-download;"/></member>
145 <member>Download MD5 sum: &corba-md5sum;</member>
146 <member>Download Size: &corba-size;</member>
147 </simplelist>
148 </para>
149 </listitem>
150 <listitem>
151 <para>Hotspot Source
152 <simplelist>
153 <member>Download: <ulink url="&hotspot-download;"/></member>
154 <member>Download MD5 sum: &hotspot-md5sum;</member>
155 <member>Download Size: &hotspot-size;</member>
156 </simplelist>
157 </para>
158 </listitem>
159 <listitem>
160 <para>IcedTea Build Source
161 <simplelist>
162 <member>Download: <ulink url="&openjdk-download;"/></member>
163 <member>Download MD5 sum: &openjdk-md5sum;</member>
164 <member>Download Size: &openjdk-size;</member>
165 </simplelist>
166 </para>
167 </listitem>
168 <listitem>
169 <para>JAXP Source
170 <simplelist>
171 <member>Download: <ulink url="&jaxp-download;"/></member>
172 <member>Download MD5 sum: &jaxp-md5sum;</member>
173 <member>Download Size: &jaxp-size;</member>
174 </simplelist>
175 </para>
176 </listitem>
177 <listitem>
178 <para>JAXWS Source
179 <simplelist>
180 <member>Download: <ulink url="&jaxws-download;"/></member>
181 <member>Download MD5 sum: &jaxws-md5sum;</member>
182 <member>Download Size: &jaxws-size;</member>
183 </simplelist>
184 </para>
185 </listitem>
186 <listitem>
187 <para>Langtools Source
188 <simplelist>
189 <member>Download: <ulink url="&langtools-download;"/></member>
190 <member>Download MD5 sum: &langtools-md5sum;</member>
191 <member>Download Size: &langtools-size;</member>
192 </simplelist>
193 </para>
194 </listitem>
195 <listitem>
196 <para>OpenJDK Source
197 <simplelist>
198 <member>Download: <ulink url="&jdk-download;"/></member>
199 <member>Download MD5 sum: &jdk-md5sum;</member>
200 <member>Download Size: &jdk-size;</member>
201 </simplelist>
202 </para>
203 </listitem>
204 <listitem>
205 <para>Estimated disk space required: &openjdk-buildsize;</para>
206 </listitem>
207 <listitem>
208 <para>Estimated build time: &openjdk-time;</para>
209 </listitem>
210 </itemizedlist>
211
212 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
213
214 <bridgehead renderas="sect4">Required Patches</bridgehead>
215 <itemizedlist spacing='compact'>
216 <listitem>
217 <para><ulink
218 url="&patch-root;/icedtea-&icedtea-version;-add_cacerts-1.patch"/></para>
219 </listitem>
220 <listitem>
221 <para><ulink
222 url="&patch-root;/icedtea-&icedtea-version;-fixed_paths-1.patch"/></para>
223 </listitem>
224 <listitem>
225 <para><ulink
226 url="&patch-root;/icedtea-&icedtea-version;-fix_new_giflib-1.patch"/></para>
227 </listitem>
228 <listitem>
229 <para><ulink
230 url="&patch-root;/icedtea-&icedtea-version;-fix_tests-1.patch"/></para>
231 </listitem>
232<!-- <listitem>
233 <para><ulink
234 url="&patch-root;/icedtea-&icedtea-version;-upstream_fix-1.patch"/></para>
235 </listitem>-->
236 </itemizedlist>
237
238 <bridgehead renderas="sect4">Required JAR</bridgehead>
239 <itemizedlist spacing='compact'>
240 <listitem>
241 <para>Rhino Java Script
242 <simplelist>
243 <member>Download: <ulink url="&rhino-download;"/></member>
244 <member>Download MD5 sum: &rhino-md5sum;</member>
245 <member>Download Size: &rhino-size;</member>
246 </simplelist>
247 </para>
248 </listitem>
249 </itemizedlist>
250 <bridgehead renderas="sect3">OpenJDK Dependencies</bridgehead>
251
252 <bridgehead renderas="sect4">Required Dependencies</bridgehead>
253 <para role="required">
254 An existing binary ( <xref linkend="java"/> or an earlier built
255 version of this package),
256 <xref linkend="alsa-lib"/>,
257 <xref linkend="apache-ant"/>,
258 <xref linkend="cacerts"/>,
259 <xref linkend="cpio"/>,
260 <xref linkend="cups"/>,
261 <xref linkend="gtk2"/>,
262 <xref linkend="giflib"/>,
263 <xref linkend="unzip"/>,
264 <xref linkend="wget"/>,
265 <xref linkend="which"/>,
266 <xref linkend="xorg7-lib"/>, and
267 <xref linkend="zip"/>
268 </para>
269
270 <bridgehead renderas="sect4">Recommended</bridgehead>
271 <para role="recommended">
272 <xref linkend="junit"/> and
273 <xref linkend="nss"/>
274 </para>
275
276 <bridgehead renderas="sect4">Optional</bridgehead>
277 <para role="optional">
278 <xref linkend="libxslt"/>,
279 <xref linkend="lsb-release"/>,
280 <xref linkend="mercurial"/>,
281 <xref linkend="mitkrb"/>,
282 <xref linkend="pulseaudio"/>, and
283 <xref linkend="xorg-server"/> (for the tests)
284 </para>
285
286 <para condition="html" role="usernotes">User Notes:
287 <ulink url="&blfs-wiki;/openjdk"/></para>
288
289 </sect2>
290
291 <sect2 role="installation">
292 <title>Installation of OpenJDK</title>
293
294 <note><para>The source build of OpenJDK requires <xref
295 linkend="apache-ant"/>. You'll need to build that first to satisfy the
296 circular dependency, and return to this section to continue building
297 OpenJDK.</para></note>
298
299 <para>Unlike other packages in BLFS, the <application>OpenJDK</application>
300 source packages are distributed in multiple downloads. Since the IcedTea
301 build harness will be used to build <application>OpenJDK</application>,
302 begin by extracting the IcedTea package and changing into the
303 extracted directory.</para>
304
305 <para>The IcedTea <application>OpenJDK</application> distribution requires
306 that <filename>js.jar</filename> (from the Rhino package) be in place in
307 order to provide a java-script implementation for the free JDK. If you have
308 not installed the js.jar file in another way, do so with the following
309 commands as the <systemitem class="username">root</systemitem> user:</para>
310
311<screen role="root"><userinput>unzip ../rhino1_7R4.zip &amp;&amp;
312install -v -d -m755 /usr/share/java &amp;&amp;
313install -v -m755 rhino1_7R4/*.jar /usr/share/java</userinput></screen>
314
315 <para>As mentioned previously, <application>OpenJDK</application> is
316 composed of several individual projects of the proprietary
317 <application>JDK</application> that have been relicensed under an open
318 source license. If you have already downoaded all of the individual
319 components, place them into the source tree with the following commands:</para>
320
321<screen><userinput>cp -v ../corba.tar.gz . &amp;&amp;
322cp -v ../hotspot.tar.gz . &amp;&amp;
323cp -v ../jaxp.tar.gz . &amp;&amp;
324cp -v ../jaxws.tar.gz . &amp;&amp;
325cp -v ../jdk.tar.gz . &amp;&amp;
326cp -v ../langtools.tar.gz . &amp;&amp;
327cp -v ../openjdk.tar.gz .</userinput></screen>
328
329<!-- Remove for 2.4.7:
330 <para>Apply a patch to fix a defect in <command>configure</command>:</para>
331
332<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-upstream_fix-1.patch</userinput></screen>
333-->
334 <para>Apply a patch to generate a valid cacerts file using the system CA
335 certificates:</para>
336
337<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-add_cacerts-1.patch</userinput></screen>
338
339 <para>Apply a patch to replace fixed paths with ones appropriate for
340 BLFS:</para>
341
342<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-fixed_paths-1.patch</userinput></screen>
343
344 <para>Apply a patch to adapt the code to the new giflib API:</para>
345
346<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-fix_new_giflib-1.patch</userinput></screen>
347
348 <para>Apply a patch to exclude known broken tests from the test suite:</para>
349
350<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-fix_tests-1.patch</userinput></screen>
351
352 <para>Configure and build the package with the following commands
353 (--with-pkgversion and --with-version-suffix values can be modified to fit
354 user preferences):</para>
355
356<screen><userinput>unset JAVA_HOME &amp;&amp;
357./autogen.sh &amp;&amp;
358./configure --with-jdk-home=/opt/OpenJDK-&openjdk-version;-bin \
359 --with-version-suffix=BLFS \
360 --enable-nss \
361 --disable-system-kerberos \
362 --with-parallel-jobs=$(getconf _NPROCESSORS_ONLN) &amp;&amp;
363make</userinput></screen>
364
365 <note><para>If you have not installed the tarballs specified above,
366 they will be automatically downloaded here.</para></note>
367
368 <para>To test the results, issue: <command>make jtregcheck</command>. The
369 included version of <application>jtreg</application> is old, and the test
370 suite is also very dependent on the host system and the environment that it
371 is run in. You should expect to see anywhere between 40 and 100 failures in
372 jdk with up to 10 errors in the tests themselves. The majority of the
373 6000+ tests should pass. The reason for the greatly varying results is due
374 to how stringent the testing environment must be. Varying architectures,
375 different versions of dependent libraries, unexpected X Window environment
376 and window managers, the CA certificates used to generate the
377 <filename>cacerts</filename> file, and even any user input or power
378 management or screen saver interruptions during the testing can lead to
379 various failures. While the known broken tests have been removed, with the
380 fix_tests patch above, the graphics tests failures cannot be pre-determined
381 (short of removing them all). The best bet for the minimal number of
382 failures is to run the test suite in a framebuffer on a different screen
383 (Xvfb). Even still, disk I/O can cause failures.</para>
384
385<screen role='nodump'><userinput>export DISPLAY=:20 &amp;&amp;
386Xvfb :20 -screen 0 1x1x24 -ac&amp;
387echo $!> Xvfb.pid &amp;&amp;
388make -k jtregcheck &amp;&amp;
389kill -9 `cat Xvfb.pid` &amp;&amp;
390unset DISPLAY &amp;&amp;
391rm -f Xvfb.pid</userinput></screen>
392
393 <para>Install the package with the following commands as the
394 <systemitem class="username">root</systemitem> user:</para>
395
396<screen role="root"><userinput>chmod 0644 openjdk.build/j2sdk-image/lib/sa-jdi.jar &amp;&amp;
397cp -R openjdk.build/j2sdk-image /opt/OpenJDK-&openjdk-version; &amp;&amp;
398chown -R root:root /opt/OpenJDK-&openjdk-version;</userinput></screen>
399
400 </sect2>
401
402 <sect2 role="commands">
403 <title>Command Explanations</title>
404
405 <para><command>./autogen.sh</command>: This command forces rebuilding of
406 auto-generated files to account for new options added to
407 <filename>configure</filename>.</para>
408
409 <para><parameter>--with-jdk-home</parameter>: This switch provides the
410 location of the temporary <application>JDK</application>.</para>
411
412 <para><option>--with-pkgversion</option>: This switch can be used
413 to modify the version string in addition to "IcedTea".</para>
414
415 <para><parameter>--with-version-suffix</parameter>: This switch appends
416 the given text to the JDK version string.</para>
417
418 <para><parameter>--enable-nss</parameter>: Enable inclusion of NSS
419 security provider.</para>
420
421 <para><parameter>--disable-system-kerberos</parameter>: Remove this switch,
422 if <xref linkend="mitkrb"/> is installed.</para>
423
424 <para><parameter>--with-parallel-jobs=$(getconf _NPROCESSORS_ONLN)</parameter>:
425 This switch sets the compiler to use all your CPUs in parallel and speed
426 up the build.</para>
427
428 <para><command>chmod -v 0644 ...sa-jdi.jar</command>: Fix permissions
429 in a generated file so all users can access it.</para>
430
431 <para><option>--enable-pulse-java</option>: This switch enables
432 building of the pulseaudio libraries (needed to provide a complete
433 implementation that is reasonably compatible with the proprietary
434 JDK). <xref linkend="pulseaudio"/> needs to be installed.</para>
435
436 </sect2>
437
438 <sect2 role="configuration" id="openjdk-config" xreflabel="Configuring OpenJDK" >
439 <title>Configuring OpenJDK</title>
440
441 <sect3>
442 <title>Configuration Information</title>
443
444 <para>There are now two <application>OpenJDK</application> SDKs
445 installed in <filename>/opt</filename>. You should decide on which one
446 you would like to use as the default. For example if you decide to use
447 the precompiled <application>OpenJDK</application>, do the following as
448 the <systemitem class="username">root</systemitem> user:</para>
449
450<screen role="root"><userinput>ln -v -nsf OpenJDK-&openjdk-version;-bin /opt/jdk</userinput></screen>
451
452 <para>The information below assumes your system is set up using the
453 instructions found in <quote><xref
454 linkend="postlfs-config-profile"/></quote>. You may need to extract the
455 relevant information below and incorporate it into your system's startup
456 files if your system is set up differently.</para>
457
458 <para>Add the following <filename>openjdk.sh</filename> shell startup
459 file to the <filename>/etc/profile.d</filename> directory with the
460 following commands as the <systemitem class="username">root</systemitem>
461 user:</para>
462
463<screen role="root"><userinput>cat &gt; /etc/profile.d/openjdk.sh &lt;&lt; "EOF"
464<literal># Begin /etc/profile.d/openjdk.sh
465
466# Set JAVA_HOME directory
467JAVA_HOME=/opt/jdk
468
469# Adjust PATH
470pathappend $JAVA_HOME/bin PATH
471
472# Auto Java CLASSPATH
473# Copy jar files to, or create symlinks in this directory
474
475AUTO_CLASSPATH_DIR=/usr/share/java
476
477pathprepend . CLASSPATH
478
479for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
480 pathappend $dir CLASSPATH
481done
482
483for jar in `find ${AUTO_CLASSPATH_DIR} -name "*.jar" 2>/dev/null`; do
484 pathappend $jar CLASSPATH
485done
486
487export JAVA_HOME CLASSPATH
488unset AUTO_CLASSPATH_DIR dir jar
489
490# End /etc/profile.d/openjdk.sh</literal>
491EOF</userinput></screen>
492
493 <para>Finally, add the man pages to <application>man_db</application>'s
494 configuration. As the <systemitem class="username">root</systemitem>
495 user:</para>
496
497<screen role="root"><userinput>cat &gt;&gt; /etc/man_db.conf &lt;&lt; "EOF" &amp;&amp;
498<literal>MANDATORY_MANPATH /opt/jdk/man
499MANPATH_MAP /opt/jdk/bin /opt/jdk/man
500MANDB_MAP /opt/jdk/man /var/cache/man/jdk</literal>
501EOF
502
503mandb -c /opt/jdk/man</userinput></screen>
504
505 </sect3>
506
507 <sect3 id='ojdk-certs'>
508 <title>Install or update the JRE Certificate Authority Certificates (cacerts) file</title>
509
510 <para>Use the following procedure to check if the
511 <filename>cacerts</filename> file was successfully installed during the
512 OpenJDK build. Also, if the <xref linkend="cacerts"/> have been updated,
513 the following instructions will generate a new JRE
514 <filename>cacerts</filename> file. First, check if the
515 <filename>cacerts</filename> have been successfully installed: </para>
516
517<screen role="root"><userinput>cd /opt/jdk
518bin/keytool -list -keystore jre/lib/security/cacerts</userinput></screen>
519
520 <para>At the prompt "Enter keystore password:", press the "Enter" key if
521 there is no keystore password defined. If the
522 <filename>cacerts</filename> were installed correctly, you will see a
523 list of the certificates with related information for each one. If not,
524 you need to manually install them. First, generate the
525 <command>mkcacerts</command> script as the
526 <systemitem class="username">root</systemitem> user:</para>
527
528<screen role="root"><userinput>cat &gt; /opt/jdk/bin/mkcacerts &lt;&lt; "EOF"
529<literal>#!/bin/sh
530# Simple script to extract x509 certificates and create a JRE cacerts file.
531
532function get_args()
533 {
534 if test -z "${1}" ; then
535 showhelp
536 exit 1
537 fi
538
539 while test -n "${1}" ; do
540 case "${1}" in
541 -f | --cafile)
542 check_arg $1 $2
543 CAFILE="${2}"
544 shift 2
545 ;;
546 -d | --cadir)
547 check_arg $1 $2
548 CADIR="${2}"
549 shift 2
550 ;;
551 -o | --outfile)
552 check_arg $1 $2
553 OUTFILE="${2}"
554 shift 2
555 ;;
556 -k | --keytool)
557 check_arg $1 $2
558 KEYTOOL="${2}"
559 shift 2
560 ;;
561 -s | --openssl)
562 check_arg $1 $2
563 OPENSSL="${2}"
564 shift 2
565 ;;
566 -h | --help)
567 showhelp
568 exit 0
569 ;;
570 *)
571 showhelp
572 exit 1
573 ;;
574 esac
575 done
576 }
577
578function check_arg()
579 {
580 echo "${2}" | grep -v "^-" > /dev/null
581 if [ -z "$?" -o ! -n "$2" ]; then
582 echo "Error: $1 requires a valid argument."
583 exit 1
584 fi
585 }
586
587# The date binary is not reliable on 32bit systems for dates after 2038
588function mydate()
589 {
590 local y=$( echo $1 | cut -d" " -f4 )
591 local M=$( echo $1 | cut -d" " -f1 )
592 local d=$( echo $1 | cut -d" " -f2 )
593 local m
594
595 if [ ${d} -lt 10 ]; then d="0${d}"; fi
596
597 case $M in
598 Jan) m="01";;
599 Feb) m="02";;
600 Mar) m="03";;
601 Apr) m="04";;
602 May) m="05";;
603 Jun) m="06";;
604 Jul) m="07";;
605 Aug) m="08";;
606 Sep) m="09";;
607 Oct) m="10";;
608 Nov) m="11";;
609 Dec) m="12";;
610 esac
611
612 certdate="${y}${m}${d}"
613 }
614
615function showhelp()
616 {
617 echo "`basename ${0}` creates a valid cacerts file for use with IcedTea."
618 echo ""
619 echo " -f --cafile The path to a file containing PEM formated CA"
620 echo " certificates. May not be used with -d/--cadir."
621 echo " -d --cadir The path to a diectory of PEM formatted CA"
622 echo " certificates. May not be used with -f/--cafile."
623 echo " -o --outfile The path to the output file."
624 echo ""
625 echo " -k --keytool The path to the java keytool utility."
626 echo ""
627 echo " -s --openssl The path to the openssl utility."
628 echo ""
629 echo " -h --help Show this help message and exit."
630 echo ""
631 echo ""
632 }
633
634# Initialize empty variables so that the shell does not pollute the script
635CAFILE=""
636CADIR=""
637OUTFILE=""
638OPENSSL=""
639KEYTOOL=""
640certdate=""
641date=""
642today=$( date +%Y%m%d )
643
644# Process command line arguments
645get_args ${@}
646
647# Handle common errors
648if test "${CAFILE}x" == "x" -a "${CADIR}x" == "x" ; then
649 echo "ERROR! You must provide an x509 certificate store!"
650 echo "\'$(basename ${0}) --help\' for more info."
651 echo ""
652 exit 1
653fi
654
655if test "${CAFILE}x" != "x" -a "${CADIR}x" != "x" ; then
656 echo "ERROR! You cannot provide two x509 certificate stores!"
657 echo "\'$(basename ${0}) --help\' for more info."
658 echo ""
659 exit 1
660fi
661
662if test "${KEYTOOL}x" == "x" ; then
663 echo "ERROR! You must provide a valid keytool program!"
664 echo "\'$(basename ${0}) --help\' for more info."
665 echo ""
666 exit 1
667fi
668
669if test "${OPENSSL}x" == "x" ; then
670 echo "ERROR! You must provide a valid path to openssl!"
671 echo "\'$(basename ${0}) --help\' for more info."
672 echo ""
673 exit 1
674fi
675
676if test "${OUTFILE}x" == "x" ; then
677 echo "ERROR! You must provide a valid output file!"
678 echo "\'$(basename ${0}) --help\' for more info."
679 echo ""
680 exit 1
681fi
682
683# Get on with the work
684
685# If using a CAFILE, split it into individual files in a temp directory
686if test "${CAFILE}x" != "x" ; then
687 TEMPDIR=`mktemp -d`
688 CADIR="${TEMPDIR}"
689
690 # Get a list of staring lines for each cert
691 CERTLIST=`grep -n "^-----BEGIN" "${CAFILE}" | cut -d ":" -f 1`
692
693 # Get a list of ending lines for each cert
694 ENDCERTLIST=`grep -n "^-----END" "${CAFILE}" | cut -d ":" -f 1`
695
696 # Start a loop
697 for certbegin in `echo "${CERTLIST}"` ; do
698 for certend in `echo "${ENDCERTLIST}"` ; do
699 if test "${certend}" -gt "${certbegin}"; then
700 break
701 fi
702 done
703 sed -n "${certbegin},${certend}p" "${CAFILE}" > "${CADIR}/${certbegin}.pem"
704 keyhash=`${OPENSSL} x509 -noout -in "${CADIR}/${certbegin}.pem" -hash`
705 echo "Generated PEM file with hash: ${keyhash}."
706 done
707fi
708
709# Write the output file
710for cert in `find "${CADIR}" -type f -name "*.pem" -o -name "*.crt"`
711do
712
713 # Make sure the certificate date is valid...
714 date=$( ${OPENSSL} x509 -enddate -in "${cert}" -noout | sed 's/^notAfter=//' )
715 mydate "${date}"
716 if test "${certdate}" -lt "${today}" ; then
717 echo "${cert} expired on ${certdate}! Skipping..."
718 unset date certdate
719 continue
720 fi
721 unset date certdate
722 ls "${cert}"
723 tempfile=`mktemp`
724 certbegin=`grep -n "^-----BEGIN" "${cert}" | cut -d ":" -f 1`
725 certend=`grep -n "^-----END" "${cert}" | cut -d ":" -f 1`
726 sed -n "${certbegin},${certend}p" "${cert}" > "${tempfile}"
727 echo yes | env LC_ALL=C "${KEYTOOL}" -import -alias `basename "${cert}"` -keystore \
728 "${OUTFILE}" -storepass 'changeit' -file "${tempfile}"
729 rm "${tempfile}"
730done
731
732if test "${TEMPDIR}x" != "x" ; then
733 rm -rf "${TEMPDIR}"
734fi
735exit 0</literal>
736EOF
737
738chmod -c 0755 /opt/jdk/bin/mkcacerts</userinput></screen>
739
740 <note>
741 <para>
742 Doing a very large copy/paste directly to a terminal may result in a
743 corrupted file. Copying to an editor may overcome this issue.
744 </para>
745 </note>
746
747 <para>First, make a backup of the
748 <filename>/opt/jdk/jre/lib/security/cacerts</filename> file, if there is
749 any. To create a new one, as the
750 <systemitem class="username">root</systemitem> user:</para>
751
752<screen role="root"><userinput>/opt/jdk/bin/mkcacerts -d "/etc/ssl/certs/" -k "/opt/jdk/bin/keytool" \
753 -s "/usr/bin/openssl" -o "/opt/jdk/jre/lib/security/cacerts"</userinput></screen>
754
755 </sect3>
756
757 </sect2>
758
759 <sect2 role="content">
760 <title>Contents</title>
761
762 <segmentedlist>
763 <segtitle>Installed Programs</segtitle>
764 <segtitle>Installed Libraries</segtitle>
765 <segtitle>Installed Directory</segtitle>
766
767 <seglistitem>
768 <seg>appletviewer, apt, extcheck, idlj, jar,
769 jarsigner, java, javac, javadoc, javah, javap, java-rmi.cgi,
770 jcmd, jconsole, jdb, jhat, jinfo, jmap, jps,
771 jrunscript, jsadebugd, jstack, jstat, jstatd, keytool,
772 native2ascii, orbd, pack200, policytool, rmic, rmid, rmiregistry,
773 schemagen, serialver, servertool, tnameserv, unpack200,
774 wsgen, wsimport, and xjc</seg>
775 <seg>/opt/OpenJDK-&openjdk-version;/lib/*, and
776 /opt/OpenJDK-&openjdk-version;/jre/lib/*</seg>
777 <seg>/opt/OpenJDK-&openjdk-version;</seg>
778 </seglistitem>
779 </segmentedlist>
780
781 <variablelist>
782 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
783 <?dbfo list-presentation="list"?>
784 <?dbhtml list-presentation="table"?>
785
786 <varlistentry id="appletviewer">
787 <term><command>appletviewer</command></term>
788 <listitem>
789 <para>allows you to run applets outside of a web browser.</para>
790 <indexterm zone="openjdk appletviewer">
791 <primary sortas="b-appletviewer">appletviewer</primary>
792 </indexterm>
793 </listitem>
794 </varlistentry>
795
796 <varlistentry id="apt">
797 <term><command>apt</command></term>
798 <listitem>
799 <para>is an annotation processing tool.</para>
800 <indexterm zone="openjdk apt">
801 <primary sortas="b-apt">apt</primary>
802 </indexterm>
803 </listitem>
804 </varlistentry>
805
806 <varlistentry id="extcheck">
807 <term><command>extcheck</command></term>
808 <listitem>
809 <para>checks a specified jar file for title and version conflicts
810 with any extensions installed in the
811 <application>OpenJDK</application> software.</para>
812 <indexterm zone="openjdk extcheck">
813 <primary sortas="b-extcheck">extcheck</primary>
814 </indexterm>
815 </listitem>
816 </varlistentry>
817
818 <varlistentry id="idlj">
819 <term><command>idlj</command></term>
820 <listitem>
821 <para>generates Java bindings from a given IDL file.</para>
822 <indexterm zone="openjdk idlj">
823 <primary sortas="b-idlj">idlj</primary>
824 </indexterm>
825 </listitem>
826 </varlistentry>
827
828 <varlistentry id="jar">
829 <term><command>jar</command></term>
830 <listitem>
831 <para>combines multiple files into a single jar archive.</para>
832 <indexterm zone="openjdk jar">
833 <primary sortas="b-jar">jar</primary>
834 </indexterm>
835 </listitem>
836 </varlistentry>
837
838 <varlistentry id="jarsigner">
839 <term><command>jarsigner</command></term>
840 <listitem>
841 <para>signs jar files and verifies the signatures and integrity
842 of a signed jar file.</para>
843 <indexterm zone="openjdk jarsigner">
844 <primary sortas="b-jarsigner">jarsigner</primary>
845 </indexterm>
846 </listitem>
847 </varlistentry>
848
849 <varlistentry id="java-prog">
850 <term><command>java</command></term>
851 <listitem>
852 <para>launches a Java application by starting a Java runtime
853 environment, loading a specified class and invoking its main
854 method.</para>
855 <indexterm zone="openjdk java-prog">
856 <primary sortas="b-java-prog">java</primary>
857 </indexterm>
858 </listitem>
859 </varlistentry>
860
861 <varlistentry id="javac">
862 <term><command>javac</command></term>
863 <listitem>
864 <para>reads class and interface definitions, written in the
865 Java programming language, and compiles them into bytecode
866 class files.</para>
867 <indexterm zone="openjdk javac">
868 <primary sortas="b-javac">javac</primary>
869 </indexterm>
870 </listitem>
871 </varlistentry>
872
873 <varlistentry id="javadoc">
874 <term><command>javadoc</command></term>
875 <listitem>
876 <para>parses the declarations and documentation comments in a
877 set of Java source files and produces a corresponding set of
878 HTML pages describing the classes, interfaces,constructors,
879 methods, and fields.</para>
880 <indexterm zone="openjdk javadoc">
881 <primary sortas="b-javadoc">javadoc</primary>
882 </indexterm>
883 </listitem>
884 </varlistentry>
885
886 <varlistentry id="javah">
887 <term><command>javah</command></term>
888 <listitem>
889 <para>generates C header and source files
890 that are needed to implement native methods.</para>
891 <indexterm zone="openjdk javah">
892 <primary sortas="b-javah">javah</primary>
893 </indexterm>
894 </listitem>
895 </varlistentry>
896
897 <varlistentry id="javap">
898 <term><command>javap</command></term>
899 <listitem>
900 <para>disassembles a Java class file.</para>
901 <indexterm zone="openjdk javap">
902 <primary sortas="b-javap">javap</primary>
903 </indexterm>
904 </listitem>
905 </varlistentry>
906
907 <varlistentry id="java-rmi.cgi">
908 <term><command>java-rmi.cgi</command></term>
909 <listitem>
910 <para>is the Java RMI client.</para>
911 <indexterm zone="openjdk java-rmi.cgi">
912 <primary sortas="b-java-rmi.cgi">java-rmi.cgi</primary>
913 </indexterm>
914 </listitem>
915 </varlistentry>
916
917 <varlistentry id="jcmd">
918 <term><command>jcmd</command></term>
919 <listitem>
920 <para>is a utility to send diagnostic command requests to a running
921 Java Virtual Machine.</para>
922 <indexterm zone="openjdk jcmd">
923 <primary sortas="b-jcmd">jcmd</primary>
924 </indexterm>
925 </listitem>
926 </varlistentry>
927
928 <varlistentry id="jconsole">
929 <term><command>jconsole</command></term>
930 <listitem>
931 <para>is a graphical console tool to monitor and manage both
932 local and remote Java applications and virtual machines.</para>
933 <indexterm zone="openjdk jconsole">
934 <primary sortas="b-jconsole">jconsole</primary>
935 </indexterm>
936 </listitem>
937 </varlistentry>
938
939 <varlistentry id="jdb">
940 <term><command>jdb</command></term>
941 <listitem>
942 <para>is a simple command-line debugger for Java classes.</para>
943 <indexterm zone="openjdk jdb">
944 <primary sortas="b-jdb">jdb</primary>
945 </indexterm>
946 </listitem>
947 </varlistentry>
948
949 <varlistentry id="jhat">
950 <term><command>jhat</command></term>
951 <listitem>
952 <para>parses a java heap dump file and allows viewing
953 in a web browser.</para>
954 <indexterm zone="openjdk jhat">
955 <primary sortas="b-jhat">jhat</primary>
956 </indexterm>
957 </listitem>
958 </varlistentry>
959
960 <varlistentry id="jinfo">
961 <term><command>jinfo</command></term>
962 <listitem>
963 <para>prints Java configuration information for a given Java
964 process, core file, or a remote debug server.</para>
965 <indexterm zone="openjdk jinfo">
966 <primary sortas="b-jinfo">jinfo</primary>
967 </indexterm>
968 </listitem>
969 </varlistentry>
970
971 <varlistentry id="jmap">
972 <term><command>jmap</command></term>
973 <listitem>
974 <para>prints shared object memory maps or heap memory details
975 of a given process, core file, or a remote debug server.</para>
976 <indexterm zone="openjdk jmap">
977 <primary sortas="b-jmap">jmap</primary>
978 </indexterm>
979 </listitem>
980 </varlistentry>
981
982 <varlistentry id="jps">
983 <term><command>jps</command></term>
984 <listitem>
985 <para>lists the instrumented JVMs on the target system.</para>
986 <indexterm zone="openjdk jps">
987 <primary sortas="b-jps">jps</primary>
988 </indexterm>
989 </listitem>
990 </varlistentry>
991
992 <varlistentry id="jrunscript">
993 <term><command>jrunscript</command></term>
994 <listitem>
995 <para>is a command line script shell.</para>
996 <indexterm zone="openjdk jrunscript">
997 <primary sortas="b-jrunscript">jrunscript</primary>
998 </indexterm>
999 </listitem>
1000 </varlistentry>
1001
1002 <varlistentry id="jsadebugd">
1003 <term><command>jsadebugd</command></term>
1004 <listitem>
1005 <para>attaches to a Java process or core file and acts as a
1006 debug server.</para>
1007 <indexterm zone="openjdk jsadebugd">
1008 <primary sortas="b-jsadebugd">jsadebugd</primary>
1009 </indexterm>
1010 </listitem>
1011 </varlistentry>
1012
1013 <varlistentry id="jstack">
1014 <term><command>jstack</command></term>
1015 <listitem>
1016 <para>prints Java stack traces of Java threads for a given
1017 Java process, core file, or a remote debug server.</para>
1018 <indexterm zone="openjdk jstack">
1019 <primary sortas="b-jstack">jstack</primary>
1020 </indexterm>
1021 </listitem>
1022 </varlistentry>
1023
1024 <varlistentry id="jstat">
1025 <term><command>jstat</command></term>
1026 <listitem>
1027 <para>displays performance statistics for an instrumented JVM.</para>
1028 <indexterm zone="openjdk jstat">
1029 <primary sortas="b-jstat">jstat</primary>
1030 </indexterm>
1031 </listitem>
1032 </varlistentry>
1033
1034 <varlistentry id="jstatd">
1035 <term><command>jstatd</command></term>
1036 <listitem>
1037 <para>is an RMI server application that monitors for the creation
1038 and termination of instrumented JVMs.</para>
1039 <indexterm zone="openjdk jstatd">
1040 <primary sortas="b-jstatd">jstatd</primary>
1041 </indexterm>
1042 </listitem>
1043 </varlistentry>
1044
1045 <varlistentry id="keytool">
1046 <term><command>keytool</command></term>
1047 <listitem>
1048 <para>is a key and certificate management utility.</para>
1049 <indexterm zone="openjdk keytool">
1050 <primary sortas="b-keytool">keytool</primary>
1051 </indexterm>
1052 </listitem>
1053 </varlistentry>
1054
1055 <varlistentry id="native2ascii">
1056 <term><command>native2ascii</command></term>
1057 <listitem>
1058 <para> converts files that contain non-supported character encoding
1059 into files containing Latin-1 or Unicode-encoded characters.</para>
1060 <indexterm zone="openjdk native2ascii">
1061 <primary sortas="b-native2ascii">native2ascii</primary>
1062 </indexterm>
1063 </listitem>
1064 </varlistentry>
1065
1066 <varlistentry id="orbd">
1067 <term><command>orbd</command></term>
1068 <listitem>
1069 <para>is used to enable clients to transparently locate and invoke
1070 persistent objects on servers in the CORBA environment.</para>
1071 <indexterm zone="openjdk orbd">
1072 <primary sortas="b-orbd">orbd</primary>
1073 </indexterm>
1074 </listitem>
1075 </varlistentry>
1076
1077 <varlistentry id="pack200">
1078 <term><command>pack200</command></term>
1079 <listitem>
1080 <para>is a Java application that transforms a jar file into a
1081 compressed pack200 file using the Java gzip compressor.</para>
1082 <indexterm zone="openjdk pack200">
1083 <primary sortas="b-pack200">pack200</primary>
1084 </indexterm>
1085 </listitem>
1086 </varlistentry>
1087
1088 <varlistentry id="policytool">
1089 <term><command>policytool</command></term>
1090 <listitem>
1091 <para>creates and manages a policy file graphically.</para>
1092 <indexterm zone="openjdk policytool">
1093 <primary sortas="b-policytool">policytool</primary>
1094 </indexterm>
1095 </listitem>
1096 </varlistentry>
1097
1098 <varlistentry id="rmic">
1099 <term><command>rmic</command></term>
1100 <listitem>
1101 <para>generates stub and skeleton class files for remote objects
1102 from the names of compiled Java classes that contain remote
1103 object implementations.</para>
1104 <indexterm zone="openjdk rmic">
1105 <primary sortas="b-rmic">rmic</primary>
1106 </indexterm>
1107 </listitem>
1108 </varlistentry>
1109
1110 <varlistentry id="rmid">
1111 <term><command>rmid</command></term>
1112 <listitem>
1113 <para>starts the activation system daemon.</para>
1114 <indexterm zone="openjdk rmid">
1115 <primary sortas="b-rmid">rmid</primary>
1116 </indexterm>
1117 </listitem>
1118 </varlistentry>
1119
1120 <varlistentry id="rmiregistry">
1121 <term><command>rmiregistry</command></term>
1122 <listitem>
1123 <para>creates and starts a remote object registry on the specified
1124 port on the current host.</para>
1125 <indexterm zone="openjdk rmiregistry">
1126 <primary sortas="b-rmiregistry">rmiregistry</primary>
1127 </indexterm>
1128 </listitem>
1129 </varlistentry>
1130
1131 <varlistentry id="schemagen">
1132 <term><command>schemagen</command></term>
1133 <listitem>
1134 <para>is a Java XML binding schema generator.</para>
1135 <indexterm zone="openjdk schemagen">
1136 <primary sortas="b-schemagen">schemagen</primary>
1137 </indexterm>
1138 </listitem>
1139 </varlistentry>
1140
1141 <varlistentry id="serialver">
1142 <term><command>serialver</command></term>
1143 <listitem>
1144 <para>returns the serialVersionUID for one or more classes in a
1145 form suitable for copying into an evolving class.</para>
1146 <indexterm zone="openjdk serialver">
1147 <primary sortas="b-serialver">serialver</primary>
1148 </indexterm>
1149 </listitem>
1150 </varlistentry>
1151
1152 <varlistentry id="servertool">
1153 <term><command>servertool</command></term>
1154 <listitem>
1155 <para>provides an ease-of-use interface for application programmers
1156 to register, unregister, startup and shutdown a server.</para>
1157 <indexterm zone="openjdk servertool">
1158 <primary sortas="b-servertool">servertool</primary>
1159 </indexterm>
1160 </listitem>
1161 </varlistentry>
1162
1163 <varlistentry id="tnameserv">
1164 <term><command>tnameserv</command></term>
1165 <listitem>
1166 <para>starts the Java IDL name server.</para>
1167 <indexterm zone="openjdk tnameserv">
1168 <primary sortas="b-tnameserv">tnameserv</primary>
1169 </indexterm>
1170 </listitem>
1171 </varlistentry>
1172
1173 <varlistentry id="unpack200">
1174 <term><command>unpack200</command></term>
1175 <listitem>
1176 <para>is a native implementation that transforms a packed file
1177 produced by <application>pack200</application> into a jar
1178 file.</para>
1179 <indexterm zone="openjdk unpack200">
1180 <primary sortas="b-unpack200">unpack200</primary>
1181 </indexterm>
1182 </listitem>
1183 </varlistentry>
1184
1185 <varlistentry id="wsgen">
1186 <term><command>wsgen</command></term>
1187 <listitem>
1188 <para>generates JAX-WS portable artifacts used in JAX-WS
1189 web services.</para>
1190 <indexterm zone="openjdk wsgen">
1191 <primary sortas="b-wsgen">wsgen</primary>
1192 </indexterm>
1193 </listitem>
1194 </varlistentry>
1195
1196 <varlistentry id="wsimport">
1197 <term><command>wsimport</command></term>
1198 <listitem>
1199 <para>generates JAX-WS portable artifacts.</para>
1200 <indexterm zone="openjdk wsimport">
1201 <primary sortas="b-wsimport">wsimport</primary>
1202 </indexterm>
1203 </listitem>
1204 </varlistentry>
1205
1206 <varlistentry id="xjc">
1207 <term><command>xjc</command></term>
1208 <listitem>
1209 <para>is a Java XML binding compiler.</para>
1210 <indexterm zone="openjdk xjc">
1211 <primary sortas="b-xjc">xjc</primary>
1212 </indexterm>
1213 </listitem>
1214 </varlistentry>
1215
1216 </variablelist>
1217
1218 </sect2>
1219
1220</sect1>
Note: See TracBrowser for help on using the repository browser.