source: general/prog/openjdk.xml@ 52a4df28

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 52a4df28 was 52a4df28, checked in by Pierre Labastie <pieere@…>, 10 years ago

Fix some Icedtea-Openjdk dependencies
add 7.5 book to revision history

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

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