source: general/prog/openjdk.xml@ 1c69133

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 1c69133 was 1c69133, checked in by Fernando de Oliveira <fernando@…>, 10 years ago

Fix icedtea dependencies, thanks Pierre L. Updates to sudo-1.8.10p2 (thanks Ken M. for removing disable-static), libgsf-1.14.30, grilo-0.2.10, grilo-plugins-0.2.12, and seamonkey-2.25 (thanks Ken M. for better placement of disable-pulseaudio).

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

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