source: general/prog/openjdk.xml@ bb11ee6

10.0 10.1 11.0 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 ken/refactor-virt krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk upgradedb xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since bb11ee6 was bb11ee6, checked in by Fernando de Oliveira <fernando@…>, 8 years ago

Reintroduce some modifications I did before and after, removed, by mistake. Change to upper case an OJDK switch vakue.

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

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