source: general/prog/openjdk.xml@ 930d280b

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 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 930d280b was 930d280b, checked in by Fernando de Oliveira <fernando@…>, 11 years ago

typo

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

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