source: general/prog/openjdk.xml@ 56605b9

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 56605b9 was 56605b9, checked in by Bruce Dubbs <bdubbs@…>, 10 years ago

Remove XML::Parser from perl modules
Archive acl, attr, intltool, expat, gperf
Synchronize libcap with LFS.

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

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