source: general/prog/openjdk.xml@ 8824a1e

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

Update to icedtea-2.5.0

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

  • Property mode set to 100644
File size: 44.9 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 "a14305c61f704b33369c433955572362">
11 <!ENTITY icedtea-size "1.9 MB">
12
13 <!ENTITY corba-download "&anduin-download;/corba.tar.bz2">
14 <!ENTITY corba-md5sum "bfcdcf4d91e511056fc81a0d771fbdff">
15 <!ENTITY corba-size "1.0 MB">
16
17 <!ENTITY hotspot-download "&anduin-download;/hotspot.tar.bz2">
18 <!ENTITY hotspot-md5sum "964b7e610177db849dbe0b2483a564a1">
19 <!ENTITY hotspot-size "7.4 MB">
20
21 <!ENTITY jaxp-download "&anduin-download;/jaxp.tar.bz2">
22 <!ENTITY jaxp-md5sum "34ce2eab91aaba3efb500a3b02051cca">
23 <!ENTITY jaxp-size "2.6 MB">
24
25 <!ENTITY jaxws-download "&anduin-download;/jaxws.tar.bz2">
26 <!ENTITY jaxws-md5sum "590460868b1c4911d3f57c4f5a80ecc7">
27 <!ENTITY jaxws-size "1.9 MB">
28
29 <!ENTITY jdk-download "&anduin-download;/jdk.tar.bz2">
30 <!ENTITY jdk-md5sum "2f2e28645f2203576d416115d5cdbd85">
31 <!ENTITY jdk-size "30.2 MB">
32
33 <!ENTITY langtools-download "&anduin-download;/langtools.tar.bz2">
34 <!ENTITY langtools-md5sum "83a383d30ebc7edaa857430ec997091b">
35 <!ENTITY langtools-size "1.6 MB">
36
37 <!ENTITY openjdk-download "&anduin-download;/openjdk.tar.bz2">
38 <!ENTITY openjdk-md5sum "5a32302cc14e7bb113d399bc9a017b23">
39 <!ENTITY openjdk-size "122 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-10 GB">
46 <!ENTITY openjdk-time "30-33 SBU (an additional 90 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<!-- Removed, since the instructions for generating cacerts have been added
217 below, and the patch does not apply cleanly-->
218 <listitem>
219 <para><ulink
220 url="&patch-root;/icedtea-&icedtea-version;-add_cacerts-1.patch"/></para>
221 </listitem>
222 <listitem>
223 <para><ulink
224 url="&patch-root;/icedtea-&icedtea-version;-fixed_paths-1.patch"/></para>
225 </listitem>
226 <listitem>
227 <para><ulink
228 url="&patch-root;/icedtea-&icedtea-version;-fix_new_giflib-1.patch"/></para>
229 </listitem>
230 <listitem>
231 <para><ulink
232 url="&patch-root;/icedtea-&icedtea-version;-fix_tests-1.patch"/></para>
233 </listitem>
234 </itemizedlist>
235
236 <bridgehead renderas="sect4">Required JAR</bridgehead>
237 <itemizedlist spacing='compact'>
238 <listitem>
239 <para>Rhino Java Script
240 <simplelist>
241 <member>Download: <ulink url="&rhino-download;"/></member>
242 <member>Download MD5 sum: &rhino-md5sum;</member>
243 <member>Download Size: &rhino-size;</member>
244 </simplelist>
245 </para>
246 </listitem>
247 </itemizedlist>
248 <bridgehead renderas="sect3">OpenJDK Dependencies</bridgehead>
249
250 <bridgehead renderas="sect4">Required Dependencies</bridgehead>
251 <para role="required">
252 An existing binary ( <xref linkend="java"/> or an earlier built
253 version of this package),
254 <xref linkend="alsa-lib"/>,
255 <xref linkend="apache-ant"/>,
256 <xref linkend="cacerts"/>,
257 <xref linkend="cpio"/>,
258 <xref linkend="cups"/>,
259 <xref linkend="gtk2"/>,
260 <xref linkend="giflib"/>,
261 <xref linkend="unzip"/>,
262 <xref linkend="wget"/>,
263 <xref linkend="which"/>,
264 <xref linkend="xorg7-lib"/>, and
265 <xref linkend="zip"/>
266 </para>
267
268 <bridgehead renderas="sect4">Recommended</bridgehead>
269 <para role="recommended">
270 <xref linkend="junit"/> and
271 <xref linkend="nss"/>
272 </para>
273
274 <bridgehead renderas="sect4">Optional</bridgehead>
275 <para role="optional">
276 <xref linkend="libxslt"/>,
277 <xref linkend="lsb-release"/>,
278 <xref linkend="mercurial"/>,
279 <xref linkend="mitkrb"/>,
280<!-- Audio support has beeen moved to icedtea-sound
281 <xref linkend="pulseaudio"/>, --> and
282 <xref linkend="xorg-server"/> (for the tests)
283 </para>
284
285 <para condition="html" role="usernotes">User Notes:
286 <ulink url="&blfs-wiki;/openjdk"/></para>
287
288 </sect2>
289
290 <sect2 role="installation">
291 <title>Installation of OpenJDK</title>
292
293 <note><para>The source build of OpenJDK requires <xref
294 linkend="apache-ant"/>. You'll need to build that first to satisfy the
295 circular dependency, and return to this section to continue building
296 OpenJDK.</para></note>
297
298 <para>Unlike other packages in BLFS, the <application>OpenJDK</application>
299 source packages are distributed in multiple downloads. Since the IcedTea
300 build harness will be used to build <application>OpenJDK</application>,
301 begin by extracting the IcedTea package and changing into the
302 extracted directory.</para>
303
304 <para>The IcedTea <application>OpenJDK</application> distribution requires
305 that <filename>js.jar</filename> (from the Rhino package) be in place in
306 order to provide a java-script implementation for the free JDK. If you have
307 not installed the js.jar file in another way, do so with the following
308 commands as the <systemitem class="username">root</systemitem> user:</para>
309
310<screen role="root"><userinput>unzip ../rhino1_7R4.zip &amp;&amp;
311install -v -d -m755 /usr/share/java &amp;&amp;
312install -v -m755 rhino1_7R4/*.jar /usr/share/java</userinput></screen>
313
314 <para>As mentioned previously, <application>OpenJDK</application> is
315 composed of several individual projects of the proprietary
316 <application>JDK</application> that have been relicensed under an open
317 source license. If you have already downloaded all of the individual
318 components, place them into the source tree with the following commands:</para>
319
320<screen><userinput>cp -v ../corba.tar.bz2 . &amp;&amp;
321cp -v ../hotspot.tar.bz2 . &amp;&amp;
322cp -v ../jaxp.tar.bz2 . &amp;&amp;
323cp -v ../jaxws.tar.bz2 . &amp;&amp;
324cp -v ../jdk.tar.bz2 . &amp;&amp;
325cp -v ../langtools.tar.bz2 . &amp;&amp;
326cp -v ../openjdk.tar.bz2 .</userinput></screen>
327
328<!-- Removed: see above-->
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 adapt the code to the new giflib API:</para>
340
341<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-fix_new_giflib-1.patch</userinput></screen>
342
343 <para>Apply a patch to exclude known broken tests from the test suite:</para>
344
345<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-fix_tests-1.patch</userinput></screen>
346
347 <para>Configure and build the package with the following commands
348 (--with-pkgversion and --with-version-suffix values can be modified to fit
349 user preferences):</para>
350
351<screen><userinput>unset JAVA_HOME &amp;&amp;
352./autogen.sh &amp;&amp;
353./configure --with-jdk-home=/opt/OpenJDK-&openjdk-version;-bin \
354 --with-version-suffix=BLFS \
355 --enable-nss \
356 --disable-system-kerberos \
357 --with-parallel-jobs &amp;&amp;
358make</userinput></screen>
359
360 <note><para>If you have not installed the tarballs specified above,
361 they will be automatically downloaded here.</para></note>
362
363 <para>To test the results, issue: <command>make jtregcheck</command>. The
364 included version of <application>jtreg</application> is old, and the test
365 suite is also very dependent on the host system and the environment that it
366 is run in. You should expect to see anywhere between 40 and 100 failures in
367 jdk with up to 10 errors in the tests themselves. The majority of the
368 6000+ tests should pass. The reason for the greatly varying results is due
369 to how stringent the testing environment must be. Varying architectures,
370 different versions of dependent libraries, unexpected X Window environment
371 and window managers, the CA certificates used to generate the
372 <filename>cacerts</filename> file, and even any user input or power
373 management or screen saver interruptions during the testing can lead to
374 various failures. While the known broken tests have been removed, with the
375 fix_tests patch above, the graphics tests failures cannot be pre-determined
376 (short of removing them all). The best bet for the minimal number of
377 failures is to run the test suite in a framebuffer on a different screen
378 (Xvfb). Even still, disk I/O can cause failures.</para>
379
380<screen role='nodump'><userinput>export DISPLAY=:20 &amp;&amp;
381Xvfb :20 -screen 0 1x1x24 -ac&amp;
382echo $!> Xvfb.pid &amp;&amp;
383make -k jtregcheck &amp;&amp;
384kill -9 `cat Xvfb.pid` &amp;&amp;
385unset DISPLAY &amp;&amp;
386rm -f Xvfb.pid</userinput></screen>
387
388 <para>Install the package with the following commands as the
389 <systemitem class="username">root</systemitem> user:</para>
390
391<screen role="root"><userinput>chmod 0644 openjdk.build/j2sdk-image/lib/sa-jdi.jar &amp;&amp;
392cp -R openjdk.build/j2sdk-image /opt/OpenJDK-&openjdk-version; &amp;&amp;
393chown -R root:root /opt/OpenJDK-&openjdk-version;</userinput></screen>
394
395 </sect2>
396
397 <sect2 role="commands">
398 <title>Command Explanations</title>
399
400 <para><command>./autogen.sh</command>: This command forces rebuilding of
401 auto-generated files to account for new options added to
402 <filename>configure</filename>.</para>
403
404 <para><parameter>--with-jdk-home</parameter>: This switch provides the
405 location of the temporary <application>JDK</application>.</para>
406
407 <para><option>--with-pkgversion</option>: This switch can be used
408 to modify the version string in addition to "IcedTea".</para>
409
410 <para><parameter>--with-version-suffix</parameter>: This switch appends
411 the given text to the JDK version string.</para>
412
413 <para><parameter>--enable-nss</parameter>: Enable inclusion of NSS
414 security provider.</para>
415
416 <para><parameter>--disable-system-kerberos</parameter>: Remove this switch,
417 if <xref linkend="mitkrb"/> is installed.</para>
418
419 <para><parameter>--with-parallel-jobs</parameter>: Allows to set the number
420 of jobs for <command>make</command> equal to the number of processors plus
421 one. Note that the default is 2 if this otion is not specified. You have to
422 explicitely set <option>--with-parallel-jobs=1</option> to disable
423 parallel jobs. The SBU given above are with parallel jobs
424 disabled.</para>
425
426 <para><command>chmod -v 0644 ...sa-jdi.jar</command>: Fix permissions
427 in a generated file so all users can access it.</para>
428<!-- Now part of icedtea-sound
429 <para><option>- -enable-pulse-java</option>: This switch enables
430 building of the pulseaudio libraries (needed to provide a complete
431 implementation that is reasonably compatible with the proprietary
432 JDK). <xref linkend="pulseaudio"/> needs to be installed.</para>
433-->
434
435 </sect2>
436
437 <sect2 role="configuration" id="openjdk-config" xreflabel="Configuring OpenJDK" >
438 <title>Configuring OpenJDK</title>
439
440 <sect3>
441 <title>Configuration Information</title>
442
443 <para>There are now two <application>OpenJDK</application> SDKs
444 installed in <filename>/opt</filename>. You should decide on which one
445 you would like to use as the default. For example if you decide to use
446 the precompiled <application>OpenJDK</application>, do the following as
447 the <systemitem class="username">root</systemitem> user:</para>
448
449<screen role="root"><userinput>ln -v -nsf OpenJDK-&openjdk-version;-bin /opt/jdk</userinput></screen>
450
451 <para>The information below assumes your system is set up using the
452 instructions found in <quote><xref
453 linkend="postlfs-config-profile"/></quote>. You may need to extract the
454 relevant information below and incorporate it into your system's startup
455 files if your system is set up differently.</para>
456
457 <para>Add the following <filename>openjdk.sh</filename> shell startup
458 file to the <filename>/etc/profile.d</filename> directory with the
459 following commands as the <systemitem class="username">root</systemitem>
460 user:</para>
461
462<screen role="root"><userinput>cat &gt; /etc/profile.d/openjdk.sh &lt;&lt; "EOF"
463<literal># Begin /etc/profile.d/openjdk.sh
464
465# Set JAVA_HOME directory
466JAVA_HOME=/opt/jdk
467
468# Adjust PATH
469pathappend $JAVA_HOME/bin PATH
470
471# Auto Java CLASSPATH
472# Copy jar files to, or create symlinks in this directory
473
474AUTO_CLASSPATH_DIR=/usr/share/java
475
476pathprepend . CLASSPATH
477
478for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
479 pathappend $dir CLASSPATH
480done
481
482for jar in `find ${AUTO_CLASSPATH_DIR} -name "*.jar" 2>/dev/null`; do
483 pathappend $jar CLASSPATH
484done
485
486export JAVA_HOME CLASSPATH
487unset AUTO_CLASSPATH_DIR dir jar
488
489# End /etc/profile.d/openjdk.sh</literal>
490EOF</userinput></screen>
491
492 <para>Finally, add the man pages to <application>man_db</application>'s
493 configuration. As the <systemitem class="username">root</systemitem>
494 user:</para>
495
496<screen role="root"><userinput>cat &gt;&gt; /etc/man_db.conf &lt;&lt; "EOF" &amp;&amp;
497<literal>MANDATORY_MANPATH /opt/jdk/man
498MANPATH_MAP /opt/jdk/bin /opt/jdk/man
499MANDB_MAP /opt/jdk/man /var/cache/man/jdk</literal>
500EOF
501
502mandb -c /opt/jdk/man</userinput></screen>
503
504 </sect3>
505
506 <sect3 id='ojdk-certs'>
507 <title>Install or update the JRE Certificate Authority Certificates (cacerts) file</title>
508
509 <para>Use the following procedure to check if the
510 <filename>cacerts</filename> file was successfully installed during the
511 OpenJDK build. Also, if the <xref linkend="cacerts"/> have been updated,
512 the following instructions will generate a new JRE
513 <filename>cacerts</filename> file. First, check if the
514 <filename>cacerts</filename> have been successfully installed: </para>
515
516<screen role="root"><userinput>cd /opt/jdk
517bin/keytool -list -keystore jre/lib/security/cacerts</userinput></screen>
518
519 <para>At the prompt "Enter keystore password:", press the "Enter" key if
520 there is no keystore password defined. If the
521 <filename>cacerts</filename> were installed correctly, you will see a
522 list of the certificates with related information for each one. If not,
523 you need to manually install them. First, generate the
524 <command>mkcacerts</command> script as the
525 <systemitem class="username">root</systemitem> user:</para>
526
527<screen role="root"><userinput>cat &gt; /opt/jdk/bin/mkcacerts &lt;&lt; "EOF"
528<literal>#!/bin/sh
529# Simple script to extract x509 certificates and create a JRE cacerts file.
530
531function get_args()
532 {
533 if test -z "${1}" ; then
534 showhelp
535 exit 1
536 fi
537
538 while test -n "${1}" ; do
539 case "${1}" in
540 -f | --cafile)
541 check_arg $1 $2
542 CAFILE="${2}"
543 shift 2
544 ;;
545 -d | --cadir)
546 check_arg $1 $2
547 CADIR="${2}"
548 shift 2
549 ;;
550 -o | --outfile)
551 check_arg $1 $2
552 OUTFILE="${2}"
553 shift 2
554 ;;
555 -k | --keytool)
556 check_arg $1 $2
557 KEYTOOL="${2}"
558 shift 2
559 ;;
560 -s | --openssl)
561 check_arg $1 $2
562 OPENSSL="${2}"
563 shift 2
564 ;;
565 -h | --help)
566 showhelp
567 exit 0
568 ;;
569 *)
570 showhelp
571 exit 1
572 ;;
573 esac
574 done
575 }
576
577function check_arg()
578 {
579 echo "${2}" | grep -v "^-" > /dev/null
580 if [ -z "$?" -o ! -n "$2" ]; then
581 echo "Error: $1 requires a valid argument."
582 exit 1
583 fi
584 }
585
586# The date binary is not reliable on 32bit systems for dates after 2038
587function mydate()
588 {
589 local y=$( echo $1 | cut -d" " -f4 )
590 local M=$( echo $1 | cut -d" " -f1 )
591 local d=$( echo $1 | cut -d" " -f2 )
592 local m
593
594 if [ ${d} -lt 10 ]; then d="0${d}"; fi
595
596 case $M in
597 Jan) m="01";;
598 Feb) m="02";;
599 Mar) m="03";;
600 Apr) m="04";;
601 May) m="05";;
602 Jun) m="06";;
603 Jul) m="07";;
604 Aug) m="08";;
605 Sep) m="09";;
606 Oct) m="10";;
607 Nov) m="11";;
608 Dec) m="12";;
609 esac
610
611 certdate="${y}${m}${d}"
612 }
613
614function showhelp()
615 {
616 echo "`basename ${0}` creates a valid cacerts file for use with IcedTea."
617 echo ""
618 echo " -f --cafile The path to a file containing PEM formated CA"
619 echo " certificates. May not be used with -d/--cadir."
620 echo " -d --cadir The path to a diectory of PEM formatted CA"
621 echo " certificates. May not be used with -f/--cafile."
622 echo " -o --outfile The path to the output file."
623 echo ""
624 echo " -k --keytool The path to the java keytool utility."
625 echo ""
626 echo " -s --openssl The path to the openssl utility."
627 echo ""
628 echo " -h --help Show this help message and exit."
629 echo ""
630 echo ""
631 }
632
633# Initialize empty variables so that the shell does not pollute the script
634CAFILE=""
635CADIR=""
636OUTFILE=""
637OPENSSL=""
638KEYTOOL=""
639certdate=""
640date=""
641today=$( date +%Y%m%d )
642
643# Process command line arguments
644get_args ${@}
645
646# Handle common errors
647if test "${CAFILE}x" == "x" -a "${CADIR}x" == "x" ; then
648 echo "ERROR! You must provide an x509 certificate store!"
649 echo "\'$(basename ${0}) --help\' for more info."
650 echo ""
651 exit 1
652fi
653
654if test "${CAFILE}x" != "x" -a "${CADIR}x" != "x" ; then
655 echo "ERROR! You cannot provide two x509 certificate stores!"
656 echo "\'$(basename ${0}) --help\' for more info."
657 echo ""
658 exit 1
659fi
660
661if test "${KEYTOOL}x" == "x" ; then
662 echo "ERROR! You must provide a valid keytool program!"
663 echo "\'$(basename ${0}) --help\' for more info."
664 echo ""
665 exit 1
666fi
667
668if test "${OPENSSL}x" == "x" ; then
669 echo "ERROR! You must provide a valid path to openssl!"
670 echo "\'$(basename ${0}) --help\' for more info."
671 echo ""
672 exit 1
673fi
674
675if test "${OUTFILE}x" == "x" ; then
676 echo "ERROR! You must provide a valid output file!"
677 echo "\'$(basename ${0}) --help\' for more info."
678 echo ""
679 exit 1
680fi
681
682# Get on with the work
683
684# If using a CAFILE, split it into individual files in a temp directory
685if test "${CAFILE}x" != "x" ; then
686 TEMPDIR=`mktemp -d`
687 CADIR="${TEMPDIR}"
688
689 # Get a list of staring lines for each cert
690 CERTLIST=`grep -n "^-----BEGIN" "${CAFILE}" | cut -d ":" -f 1`
691
692 # Get a list of ending lines for each cert
693 ENDCERTLIST=`grep -n "^-----END" "${CAFILE}" | cut -d ":" -f 1`
694
695 # Start a loop
696 for certbegin in `echo "${CERTLIST}"` ; do
697 for certend in `echo "${ENDCERTLIST}"` ; do
698 if test "${certend}" -gt "${certbegin}"; then
699 break
700 fi
701 done
702 sed -n "${certbegin},${certend}p" "${CAFILE}" > "${CADIR}/${certbegin}.pem"
703 keyhash=`${OPENSSL} x509 -noout -in "${CADIR}/${certbegin}.pem" -hash`
704 echo "Generated PEM file with hash: ${keyhash}."
705 done
706fi
707
708# Write the output file
709for cert in `find "${CADIR}" -type f -name "*.pem" -o -name "*.crt"`
710do
711
712 # Make sure the certificate date is valid...
713 date=$( ${OPENSSL} x509 -enddate -in "${cert}" -noout | sed 's/^notAfter=//' )
714 mydate "${date}"
715 if test "${certdate}" -lt "${today}" ; then
716 echo "${cert} expired on ${certdate}! Skipping..."
717 unset date certdate
718 continue
719 fi
720 unset date certdate
721 ls "${cert}"
722 tempfile=`mktemp`
723 certbegin=`grep -n "^-----BEGIN" "${cert}" | cut -d ":" -f 1`
724 certend=`grep -n "^-----END" "${cert}" | cut -d ":" -f 1`
725 sed -n "${certbegin},${certend}p" "${cert}" > "${tempfile}"
726 echo yes | env LC_ALL=C "${KEYTOOL}" -import -alias `basename "${cert}"` -keystore \
727 "${OUTFILE}" -storepass 'changeit' -file "${tempfile}"
728 rm "${tempfile}"
729done
730
731if test "${TEMPDIR}x" != "x" ; then
732 rm -rf "${TEMPDIR}"
733fi
734exit 0</literal>
735EOF
736
737chmod -c 0755 /opt/jdk/bin/mkcacerts</userinput></screen>
738
739 <note>
740 <para>
741 Doing a very large copy/paste directly to a terminal may result in a
742 corrupted file. Copying to an editor may overcome this issue.
743 </para>
744 </note>
745
746 <para>If you need to generate a <filename>cacerts</filename> file,
747 and there is already one in
748 <filename class="directory">/opt/jdk/jre/lib/security</filename>, it
749 is better to make a backup. Then, you can 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.