source: general/prog/openjdk.xml@ d74762c

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

Updates to wpa_supplicant-2.1, Git-1.8.5.5, xulrunner/firefox-27.0.1, lynx2.8.8rel.1, and ImageMagick-6.8.8-6. OpenJDK-1.7.0.51/IcedTea-2.4.5: add lsb_release-1.4 as optional dependency.

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