source: general/prog/openjdk.xml@ 05316fa

7.6-blfs 7.6-systemd kde5-14269 kde5-14686 systemd-13485
Last change on this file since 05316fa was 05316fa, checked in by Christopher Gregory <cjg@…>, 10 years ago

Added fastjar ulink to openjdk requirements as configure now fails if it is not found.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@13852 af4574ff-66df-0310-9fd7-8a98e5e911e0

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