source: general/prog/openjdk.xml@ b914c2e

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.6 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind 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 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since b914c2e was b914c2e, checked in by Pierre Labastie <pieere@…>, 10 years ago

Update to Icedtea 2.5.1

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

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