source: general/prog/openjdk.xml@ 5aa8088

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 5aa8088 was 5aa8088, checked in by Pierre Labastie <pieere@…>, 9 years ago

Update to OpenJDK-1.8.0.60

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

  • Property mode set to 100644
File size: 44.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY ojdk-upd "60">
8 <!ENTITY ojdk-bd "b27">
9 <!ENTITY ojdk-tarball "jdk8u&ojdk-upd;-&ojdk-bd;.tar.bz2">
10 <!ENTITY ojdk-repo "http://hg.openjdk.java.net/jdk8u/jdk8u60">
11 <!ENTITY ojdk-download "&ojdk-repo;/archive/&ojdk-tarball;">
12
13 <!ENTITY anduin-download "http://anduin.linuxfromscratch.org/files/BLFS/OpenJDK-&openjdk-version;">
14
15 <!ENTITY ojdk-md5sum "bcaf6f51627e8f052eff0fdcd8578b4f">
16 <!ENTITY ojdk-size "395 KB">
17
18 <!ENTITY corba-md5sum "002432f496bab8c85f6baf61d65dca27">
19 <!ENTITY hotspot-md5sum "a4ebec7c61aa154804761127a1f75eae">
20 <!ENTITY jaxp-md5sum "9a7b2a534b4a01ebb559b60023882809">
21 <!ENTITY jaxws-md5sum "7ff3e1154d79d208ae89c24355254b49">
22 <!ENTITY jdk-md5sum "2f5874a62c2bc74b99118f66d82886da">
23 <!ENTITY langtools-md5sum "57ccac8dc86d993e64ff920feb9e54ab">
24 <!ENTITY nashorn-md5sum "a8fccf7be7451205e6048b9b2fcd5b24">
25 <!ENTITY total-download-size "52 MB">
26
27 <!ENTITY jtreg-version "4.1-b12-389">
28 <!ENTITY jtreg-download "&anduin-download;/jtreg-&jtreg-version;.tar.gz">
29 <!ENTITY jtreg-md5sum "30a99ab95186741778ae3fa2b248b83b">
30 <!ENTITY jtreg-size "7.4 MB">
31
32 <!ENTITY icedtea-web-download "http://icedtea.classpath.org/download/source/icedtea-web-&icedtea-web-version;.tar.gz">
33
34 <!ENTITY ojdk-buildsize "3.7 GB (additional 371 MB for tests)">
35 <!ENTITY ojdk-time "12 SBU (additional 100 SBU for tests)">
36]>
37
38<sect1 id="openjdk"
39 xreflabel="OpenJDK-&openjdk-version;">
40 <?dbhtml filename="openjdk.html" ?>
41
42 <sect1info>
43 <othername>$LastChangedBy$</othername>
44 <date>$Date$</date>
45 </sect1info>
46
47 <title>OpenJDK-&openjdk-version;</title>
48
49 <indexterm zone="openjdk">
50 <primary sortas="a-OpenJDK">OpenJDK</primary>
51 </indexterm>
52
53 <sect2 role="package">
54 <title>Introduction to OpenJDK</title>
55
56 <para>
57 <application>OpenJDK</application> is an open-source implementation
58 of Oracle's Java Standard Edition platform.
59 <application>OpenJDK</application> is useful for developing
60 <application>Java</application> programs, and provides a complete
61 runtime environment to run <application>Java</application> programs.
62 </para>
63
64 &lfs78_checked;
65
66 <note>
67 <para>
68 A browser plugin and webstart implementation, as well as a
69 pulseaudio sound backend are provided by the Icedtea project. To provide
70 a complete implementation, you will need to later install
71 <xref linkend="icedtea-web"/> and <xref linkend="icedtea-sound"/>.
72 </para>
73 </note>
74
75 <para>
76 OpenJDK is GPL'd code, with a special exception made for non-free
77 projects to use these classes in their proprietary products.
78 In similar fashion to the LGPL, which allows non-free programs to link
79 to libraries provided by free software, the
80 <ulink url="http://openjdk.java.net/legal/gplv2+ce.html">GNU
81 General Public License, version 2, with the Classpath Exception</ulink>
82 allows third party programs to use classes provided by free software
83 without the requirement that the third party software also be free. As
84 with the LGPL, any modifications made to the free software portions of a
85 third party application, must also be made freely available.
86 </para>
87
88 <note>
89 <para>
90 The <application>OpenJDK</application> source includes a very
91 thorough, open source test suite using the
92 <application>JTreg</application> test harness. The testing instructions
93 below allow to test the just built JDK for reasonable compatibility
94 with the proprietary Oracle JDK. However, in order for an independent
95 implementation to claim compatibility, it must pass a proprietary
96 <application>JCK/TCK</application> test suite. No claims of
97 compatibility, even partial compatibility, may be made without passing
98 an approved test suite.
99 </para>
100
101 <para>
102 Oracle does provide free community access, on a case by case basis, to
103 a closed toolkit to ensure 100% compatibility with its proprietary JDK.
104 Neither the binary version provided on the <xref linkend="java"/> page
105 nor the JVM built with the instructions below have been tested against
106 the <ulink
107 url="http://openjdk.java.net/groups/conformance/JckAccess/jck-access.html">
108 TCK</ulink>. Any version that is built using the instructions given,
109 cannot claim to be compatible with the proprietary JDK, without the
110 user applying for, and completing the compatibility tests themselves.
111 </para>
112
113 <para>
114 With that in mind, the binaries produced using this build method are
115 regularly tested against the TCK by the members listed on the site
116 above. In addition to the community license above, an educational,
117 non-commercial license for the TCK can be obtained from <ulink
118 url="http://www.oracle.com/technetwork/java/index-137188.html">
119 here</ulink>.
120 </para>
121 </note>
122
123 <bridgehead renderas="sect3">Source Package Information</bridgehead>
124 <itemizedlist spacing="compact">
125 <listitem>
126 <para>OpenJDK Root Package
127 <simplelist>
128 <member>Download: <ulink url="&ojdk-download;"/></member>
129 <member>Download MD5 sum: &ojdk-md5sum;</member>
130 <member>Download Size: &ojdk-size;</member>
131 </simplelist>
132 </para>
133 </listitem>
134 <listitem>
135 <para>
136 In addition to the root package, the instructions below first
137 download seven subproject tarballs,
138 whose total size is &total-download-size;.
139 </para>
140 </listitem>
141 <listitem>
142 <para>Estimated disk space required: &ojdk-buildsize;</para>
143 </listitem>
144 <listitem>
145 <para>Estimated build time: &ojdk-time;</para>
146 </listitem>
147 </itemizedlist>
148
149 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
150
151 <itemizedlist spacing='compact'>
152 <listitem>
153 <para>
154 Optional package (to get an icon for the
155 <filename>openjdk-8-policytool.desktop</filename> file):
156 <ulink url="&icedtea-web-download;"/>
157 </para>
158 </listitem>
159 <listitem>
160 <para>
161 Recommended test harness: <ulink url="&jtreg-download;"/>
162 </para>
163 </listitem>
164 </itemizedlist>
165
166 <bridgehead renderas="sect3">OpenJDK Dependencies</bridgehead>
167
168 <bridgehead renderas="sect4">Required Dependencies</bridgehead>
169 <para role="required">
170 An existing binary (<xref linkend="java"/> or an earlier built
171 version of this package),
172 <xref linkend="alsa-lib"/>,
173 <xref linkend="cpio"/>,
174 <xref linkend="cups"/>,
175 <xref linkend="unzip"/>,
176 <xref linkend="which"/>,
177 <xref linkend="xorg7-lib"/>, and
178 <xref linkend="zip"/>
179 </para>
180
181 <bridgehead renderas="sect4">Recommended</bridgehead>
182 <para role="recommended">
183 <xref linkend="cacerts"/>,
184 <xref linkend="giflib"/>, and
185 <xref linkend="wget"/>
186 </para>
187
188 <bridgehead renderas="sect4">Optional</bridgehead>
189 <para role="optional">
190 <xref linkend="mercurial"/> and
191 an X Window manager such as <xref linkend="twm"/> (for the tests)
192 </para>
193
194 <para condition="html" role="usernotes">User Notes:
195 <ulink url="&blfs-wiki;/openjdk"/></para>
196
197 </sect2>
198
199 <sect2 role="installation">
200 <title>Installation of OpenJDK</title>
201
202 <para>
203 Unlike other packages in BLFS, the <application>OpenJDK</application>
204 source packages are distributed in multiple tar balls. You need to first
205 extract the source root from <filename>&ojdk-tarball;</filename>, change
206 into the extracted directory, then proceed with the following
207 instructions:
208 </para>
209
210<screen><userinput>cat &gt; subprojects.md5 &lt;&lt; EOF &amp;&amp;
211&corba-md5sum; corba.tar.bz2
212&hotspot-md5sum; hotspot.tar.bz2
213&jaxp-md5sum; jaxp.tar.bz2
214&jaxws-md5sum; jaxws.tar.bz2
215&langtools-md5sum; langtools.tar.bz2
216&jdk-md5sum; jdk.tar.bz2
217&nashorn-md5sum; nashorn.tar.bz2
218EOF
219
220for subproject in corba hotspot jaxp jaxws langtools jdk nashorn; do
221 wget -c &ojdk-repo;/${subproject}/archive/&ojdk-tarball; \
222 -O ${subproject}.tar.bz2
223done &amp;&amp;
224
225md5sum -c subprojects.md5 &amp;&amp;
226
227for subproject in corba hotspot jaxp jaxws langtools jdk nashorn; do
228 mkdir -pv ${subproject} &amp;&amp;
229 tar -xf ${subproject}.tar.bz2 --strip-components=1 -C ${subproject}
230done</userinput></screen>
231
232 <para>
233 If you have downloaded the recommended test harness, unpack it too:
234 </para>
235
236<screen><userinput>tar -xf ../jtreg-&jtreg-version;.tar.gz</userinput></screen>
237
238<!--TODO: it might be better to add instructions for the cacerts file at
239this place and to use the switch "with-cacerts-file" -->
240
241 <note>
242 <para>
243 Before proceeding, you should ensure that your environment
244 <envar>PATH</envar> variable contains the location of the Java
245 compilers used for bootstrapping <application>OpenJDK</application>.
246 This is the only requirement for the environment. Modern Java
247 installations do not need <envar>JAVA_HOME</envar> and
248 <envar>CLASSPATH</envar> is not used here. Furthermore, OpenJDK
249 developers recommend to unset <envar>JAVA_HOME</envar>.
250 </para>
251
252 <para>
253 The build system does not support the <option>-j</option> switch in
254 <envar>MAKEFLAGS</envar>.
255 </para>
256 </note>
257
258 <para>
259 Configure and build the package with the following commands
260 (--with-milestone value can be modified to fit user preferences):
261 </para>
262
263<screen><userinput>unset JAVA_HOME &amp;&amp;
264sh ./configure \
265 --with-update-version=&ojdk-upd; \
266 --with-build-number=&ojdk-bd; \
267 --with-milestone=BLFS \
268 --enable-unlimited-crypto \
269 --with-zlib=system \
270 --with-giflib=system &amp;&amp;
271make DEBUG_BINARIES=true all &amp;&amp;
272find build/*/images/j2sdk-image -iname \*.diz -delete
273</userinput></screen>
274
275 <note>
276 <para>
277 Testing will involve the interplay of pairs of JVMs using the
278 networking interface, so networking must be started. If it
279 isn't, not only will these tests fail, but the test cleanup
280 will leave orphaned JVMs running. There will be many of
281 them. Rebooting may be the easiest recovery.
282 </para>
283 </note>
284
285 <para>
286 Testing the newly built JVM involves several steps.
287 First, it is better to run the test suite in a frame buffer on a
288 different display, using Xvfb:
289 </para>
290
291<!-- Careful with the && below:
292"export DISPLAY=... && somecommand &" exports only DISPLAY to "somecommand"
293but not to the current environment, and
294"echo $! .... &&" does not echo the right PID. So all && suppressed.-->
295<screen role='nodump'><userinput>if [ -n "$DISPLAY" ]; then
296 OLD_DISP=$DISPLAY
297fi
298export DISPLAY=:20
299nohup Xvfb $DISPLAY \
300 -fbdir $(pwd) \
301 -pixdepths 8 16 24 32 > Xvfb.out 2>&amp;1 &amp;
302echo $! > Xvfb.pid
303echo Waiting for Xvfb to initialize; sleep 1
304nohup twm -display $DISPLAY \
305 -f /dev/null > twm.out 2>&amp;1 &amp;
306echo $! > twm.pid
307echo Waiting for twm to initialize; sleep 1
308xhost +</userinput></screen>
309
310 <para>
311 Then, it is necessary to modify some files<!-- (replace &lt;N&gt; with the
312 number of JAVA VM allowed to run concurrently)-->:
313 </para>
314
315<screen role='nodump'><userinput>echo -e "
316jdk_all = :jdk_core \\
317 :jdk_svc \\
318 :jdk_beans \\
319 :jdk_imageio \\
320 :jdk_sound \\
321 :jdk_sctp \\
322 com/sun/awt \\
323 javax/accessibility \\
324 javax/print \\
325 sun/pisces \\
326 com/sun/java/swing" >> jdk/test/TEST.groups &amp;&amp;
327sed -e 's/all:.*jck.*/all: jtreg/' \
328 -e '/^JTREG /s@\$(JT_PLATFORM)/@@' \
329 -i langtools/test/Makefile<!-- &amp;&amp;
330sed -i 's@/win32@@' jdk/test/Makefile &amp;&amp;
331sed -e 's@JTREG_HOME@JT_PLATFORM="" &amp;@' \
332 -e 's@TEST="@CONCURRENCY=&lt;N&gt; &amp;@' \
333 -i test/Makefile--></userinput></screen>
334
335 <para>
336 Some variables have to be set:
337 </para>
338
339<screen role='nodump'><userinput>JT_JAVA=$(type -p javac | sed 's@/bin.*@@') &amp;&amp;
340JT_HOME=$(pwd)/jtreg &amp;&amp;
341PRODUCT_HOME=$(echo $(pwd)/build/*/images/j2sdk-image)</userinput></screen>
342
343 <para>
344 The tests are run as follows:
345 </para>
346
347<!-- no && here either, because the first "make" may return an error -->
348<screen role='nodump'><userinput>LANG=C make -k -C test \
349 JT_HOME=${JT_HOME} \
350 JT_JAVA=${JT_JAVA} \
351 PRODUCT_HOME=${PRODUCT_HOME} all
352LANG=C ${JT_HOME}/bin/jtreg -a -v:fail,error \
353 -dir:$(pwd)/hotspot/test \
354 -k:\!ignore \
355 -jdk:${PRODUCT_HOME} \
356<!-- -agentvm -conc:&lt;N&gt; \
357--> :jdk</userinput></screen>
358
359 <para>
360 The test results can be compared to
361 <ulink url="http://download.java.net/openjdk/testresults/8/">these
362 results</ulink>, although they usually are run on a newer version.
363 Some failures can be expected, the number of which depends on various
364 conditions, like whether the computer is connected to network. Also, some
365 tests may timeout if the machine is under load.
366 </para>
367
368 <para>
369 Next some cleanup has to be done. The instructions below only stop the
370 frame buffer, but it has been reported that some java VM may be left
371 running after the tests, so it is necessary to check orphaned processes:
372 </para>
373
374<screen role='nodump'><userinput>kill -9 `cat twm.pid` &amp;&amp;
375kill -9 `cat Xvfb.pid` &amp;&amp;
376rm -f Xvfb.out twm.out &amp;&amp;
377rm -f Xvfb.pid twm.pid &amp;&amp;
378if [ -n "$OLD_DISP" ]; then
379 DISPLAY=$OLD_DISP
380fi</userinput></screen>
381
382 <para>Install the package with the following commands as the
383 <systemitem class="username">root</systemitem> user:</para>
384
385<screen role="root"><userinput>cp -RT build/*/images/j2sdk-image /opt/OpenJDK-&openjdk-version; &amp;&amp;
386chown -R root:root /opt/OpenJDK-&openjdk-version;</userinput></screen>
387
388 <para>
389 There are now two <application>OpenJDK</application> SDKs installed
390 in <filename class="directory">/opt</filename>. You should decide on
391 which one you would like to use as the default. Normally, you would opt
392 for the just installed <application>OpenJDK</application>. If so, do
393 the following as the <systemitem class="username">root</systemitem>
394 user:
395 </para>
396
397<screen role="root"><userinput>ln -v -nsf OpenJDK-&openjdk-version; /opt/jdk</userinput></screen>
398
399 <para>If desired, you may install a .desktop file corresponding to an entry
400 in a desktop menu for <command>policytool</command>. First, you need to
401 obtain an icon from <xref linkend="icedtea-web"/>:</para>
402
403<screen><userinput>tar -xf ../icedtea-web-&icedtea-web-version;.tar.gz \
404 icedtea-web-&icedtea-web-version;/javaws.png \
405 --strip-components=1</userinput></screen>
406
407 <para>Now, as <systemitem class="username">root</systemitem> user:</para>
408
409<screen role="root"><userinput>mkdir -pv /usr/share/applications &amp;&amp;
410
411cat &gt; /usr/share/applications/openjdk-8-policytool.desktop &lt;&lt; "EOF" &amp;&amp;
412<literal>[Desktop Entry]
413Name=OpenJDK Java Policy Tool
414Name[pt_BR]=OpenJDK Java - Ferramenta de Pol&#237;tica
415Comment=OpenJDK Java Policy Tool
416Comment[pt_BR]=OpenJDK Java - Ferramenta de Pol&#237;tica
417Exec=/opt/jdk/bin/policytool
418Terminal=false
419Type=Application
420Icon=javaws
421Categories=Settings;</literal>
422EOF
423
424install -v -Dm0644 javaws.png /usr/share/pixmaps/javaws.png</userinput></screen>
425
426 <para>The choice of pt_BR is just an example. You can add any translation
427 by adding lines corresponding to your locale, e.g. for fr_FR,
428 <quote>Name[fr_FR]=</quote> and <quote>Comment[fr_FR]=</quote> with the
429 appropriate text as values.</para>
430
431 </sect2>
432
433 <sect2 role="commands">
434 <title>Command Explanations</title>
435
436 <para>
437 <command>sh configure...</command>: the top level
438 <filename>configure</filename> is a wrapper around the autotools one.
439 It is not executable and must be run through <command>sh</command>.
440 </para>
441
442 <para>
443 <option>--with-boot-jdk</option>: This switch provides the
444 location of the temporary <application>JDK</application>. It is normally
445 not needed if <command>java</command> is found in the <envar>PATH</envar>.
446 </para>
447
448 <para>
449 <parameter>--with-update-version</parameter>: Currently, the build
450 system does not include the update number in the version string. It has
451 to be specified here.
452 </para>
453
454 <para>
455 <parameter>--with-build-number</parameter>: Again, the build
456 system does not include the build number in the version string. It has
457 to be specified here too.
458 </para>
459
460 <para>
461 <parameter>--with-milestone</parameter>: Used to customize the
462 version string.
463 </para>
464
465 <para>
466 <parameter>--enable-unlimited-crypto</parameter>: Because of limitations
467 on the usage of cryptography in some countries, there is the possibility
468 to limit the size of encryption keys and the use of some algorithms in a
469 policy file. This switch allows to ship a policy file with no
470 restriction. It is the responsability of the user to ensure proper
471 adherence to the law.
472 </para>
473
474 <para>
475 <parameter>--with-zlib=system, --with-giflib=system</parameter>: Allows
476 to use the system libraries instead of the bundled ones.
477 </para>
478
479 <para>
480 <option>--with-jobs=N</option>: Allows setting the number
481 of jobs for <command>make</command> equal to N. The default is the
482 result of a calculation involving the available memory and the number
483 of processors. Note that even if you specify N=1, some parallelization
484 may be used during the build. The SBU given above are with parallel jobs
485 disabled, on a single processor, single core, virtual machine.
486 </para>
487
488 <para>
489 <option>--with-cacerts-file=...</option>: Specifies where to find a
490 <filename>cacerts</filename> file, typically <filename>
491 /opt/jdk/jre/lib/security</filename>. Otherwise, an empty one is created.
492 You can get it from an earlier version of the package, or use the
493 script below to generate one.
494 </para>
495
496 <para>
497 <command>make DEBUG_BINARIES=true all</command>: The build fails on
498 32 bit machines if DEBUG_BINARIES is not set to true.
499 </para>
500
501 <para>
502 <command>find ... -iname '*.diz' -delete</command>: This command
503 removes redundant files.
504 </para>
505
506 </sect2>
507
508 <sect2 role="configuration"
509 id="openjdk-config"
510 xreflabel="Configuring OpenJDK">
511 <title>Configuring OpenJDK</title>
512
513 <sect3>
514 <title>Configuration Information</title>
515
516 <para>
517 Normally, the JAVA environment has been configured after installing
518 the binary version, and can be used with the just built package as well.
519 Review <xref linkend="ojdk-conf"/> in case you want to modify
520 something.
521 </para>
522
523 <para>
524 To test if the man pages are correctly installed, issue
525 <command>source /etc/profile</command> and <command>man java</command>
526 to display the respective man page.
527 </para>
528
529 </sect3>
530
531 <sect3 id='ojdk-certs' xreflabel='JRE Certificate Authorithy Certificates'>
532 <title>Install or update the JRE Certificate Authority Certificates
533 (cacerts) file</title>
534
535 <para>
536 <application>OpenJDK</application> uses its own format for the
537 CA certificates. Those certificates are located in a file named
538 <filename>/opt/jdk/jre/lib/security/cacerts</filename>. That file
539 may be generated from the one installed using the instructions on the
540 <xref linkend="cacerts"/> page, with the following procedure.
541 First, generate the <command>mkcacerts</command> script
542 as the <systemitem class="username">root</systemitem> user:
543 </para>
544
545<screen role="root"><userinput>cat &gt; /opt/jdk/bin/mkcacerts &lt;&lt; "EOF"
546<literal>#!/bin/sh
547# Simple script to extract x509 certificates and create a JRE cacerts file.
548
549function get_args()
550 {
551 if test -z "${1}" ; then
552 showhelp
553 exit 1
554 fi
555
556 while test -n "${1}" ; do
557 case "${1}" in
558 -f | --cafile)
559 check_arg $1 $2
560 CAFILE="${2}"
561 shift 2
562 ;;
563 -d | --cadir)
564 check_arg $1 $2
565 CADIR="${2}"
566 shift 2
567 ;;
568 -o | --outfile)
569 check_arg $1 $2
570 OUTFILE="${2}"
571 shift 2
572 ;;
573 -k | --keytool)
574 check_arg $1 $2
575 KEYTOOL="${2}"
576 shift 2
577 ;;
578 -s | --openssl)
579 check_arg $1 $2
580 OPENSSL="${2}"
581 shift 2
582 ;;
583 -h | --help)
584 showhelp
585 exit 0
586 ;;
587 *)
588 showhelp
589 exit 1
590 ;;
591 esac
592 done
593 }
594
595function check_arg()
596 {
597 echo "${2}" | grep -v "^-" > /dev/null
598 if [ -z "$?" -o ! -n "$2" ]; then
599 echo "Error: $1 requires a valid argument."
600 exit 1
601 fi
602 }
603
604# The date binary is not reliable on 32bit systems for dates after 2038
605function mydate()
606 {
607 local y=$( echo $1 | cut -d" " -f4 )
608 local M=$( echo $1 | cut -d" " -f1 )
609 local d=$( echo $1 | cut -d" " -f2 )
610 local m
611
612 if [ ${d} -lt 10 ]; then d="0${d}"; fi
613
614 case $M in
615 Jan) m="01";;
616 Feb) m="02";;
617 Mar) m="03";;
618 Apr) m="04";;
619 May) m="05";;
620 Jun) m="06";;
621 Jul) m="07";;
622 Aug) m="08";;
623 Sep) m="09";;
624 Oct) m="10";;
625 Nov) m="11";;
626 Dec) m="12";;
627 esac
628
629 certdate="${y}${m}${d}"
630 }
631
632function showhelp()
633 {
634 echo "`basename ${0}` creates a valid cacerts file for use with IcedTea."
635 echo ""
636 echo " -f --cafile The path to a file containing PEM"
637 echo " formated CA certificates. May not be"
638 echo " used with -d/--cadir."
639 echo ""
640 echo " -d --cadir The path to a directory of PEM formatted"
641 echo " CA certificates. May not be used with"
642 echo " -f/--cafile."
643 echo ""
644 echo " -o --outfile The path to the output file."
645 echo ""
646 echo " -k --keytool The path to the java keytool utility."
647 echo ""
648 echo " -s --openssl The path to the openssl utility."
649 echo ""
650 echo " -h --help Show this help message and exit."
651 echo ""
652 echo ""
653 }
654
655# Initialize empty variables so that the shell does not pollute the script
656CAFILE=""
657CADIR=""
658OUTFILE=""
659OPENSSL=""
660KEYTOOL=""
661certdate=""
662date=""
663today=$( date +%Y%m%d )
664
665# Process command line arguments
666get_args ${@}
667
668# Handle common errors
669if test "${CAFILE}x" == "x" -a "${CADIR}x" == "x" ; then
670 echo "ERROR! You must provide an x509 certificate store!"
671 echo "\'$(basename ${0}) --help\' for more info."
672 echo ""
673 exit 1
674fi
675
676if test "${CAFILE}x" != "x" -a "${CADIR}x" != "x" ; then
677 echo "ERROR! You cannot provide two x509 certificate stores!"
678 echo "\'$(basename ${0}) --help\' for more info."
679 echo ""
680 exit 1
681fi
682
683if test "${KEYTOOL}x" == "x" ; then
684 echo "ERROR! You must provide a valid keytool program!"
685 echo "\'$(basename ${0}) --help\' for more info."
686 echo ""
687 exit 1
688fi
689
690if test "${OPENSSL}x" == "x" ; then
691 echo "ERROR! You must provide a valid path to openssl!"
692 echo "\'$(basename ${0}) --help\' for more info."
693 echo ""
694 exit 1
695fi
696
697if test "${OUTFILE}x" == "x" ; then
698 echo "ERROR! You must provide a valid output file!"
699 echo "\'$(basename ${0}) --help\' for more info."
700 echo ""
701 exit 1
702fi
703
704# Get on with the work
705
706# If using a CAFILE, split it into individual files in a temp directory
707if test "${CAFILE}x" != "x" ; then
708 TEMPDIR=`mktemp -d`
709 CADIR="${TEMPDIR}"
710
711 # Get a list of staring lines for each cert
712 CERTLIST=`grep -n "^-----BEGIN" "${CAFILE}" | cut -d ":" -f 1`
713
714 # Get a list of ending lines for each cert
715 ENDCERTLIST=`grep -n "^-----END" "${CAFILE}" | cut -d ":" -f 1`
716
717 # Start a loop
718 for certbegin in `echo "${CERTLIST}"` ; do
719 for certend in `echo "${ENDCERTLIST}"` ; do
720 if test "${certend}" -gt "${certbegin}"; then
721 break
722 fi
723 done
724 sed -n "${certbegin},${certend}p" "${CAFILE}" > "${CADIR}/${certbegin}.pem"
725 keyhash=`${OPENSSL} x509 -noout -in "${CADIR}/${certbegin}.pem" -hash`
726 echo "Generated PEM file with hash: ${keyhash}."
727 done
728fi
729
730# Write the output file
731for cert in `find "${CADIR}" -type f -name "*.pem" -o -name "*.crt"`
732do
733
734 # Make sure the certificate date is valid...
735 date=$( ${OPENSSL} x509 -enddate -in "${cert}" -noout | sed 's/^notAfter=//' )
736 mydate "${date}"
737 if test "${certdate}" -lt "${today}" ; then
738 echo "${cert} expired on ${certdate}! Skipping..."
739 unset date certdate
740 continue
741 fi
742 unset date certdate
743 ls "${cert}"
744 tempfile=`mktemp`
745 certbegin=`grep -n "^-----BEGIN" "${cert}" | cut -d ":" -f 1`
746 certend=`grep -n "^-----END" "${cert}" | cut -d ":" -f 1`
747 sed -n "${certbegin},${certend}p" "${cert}" > "${tempfile}"
748 echo yes | env LC_ALL=C "${KEYTOOL}" -import \
749 -alias `basename "${cert}"` \
750 -keystore "${OUTFILE}" \
751 -storepass 'changeit' \
752 -file "${tempfile}"
753 rm "${tempfile}"
754done
755
756if test "${TEMPDIR}x" != "x" ; then
757 rm -rf "${TEMPDIR}"
758fi
759exit 0</literal>
760EOF
761
762chmod -c 0755 /opt/jdk/bin/mkcacerts</userinput></screen>
763
764 <note>
765 <para>
766 Doing a very large copy/paste directly to a terminal may result in a
767 corrupted file. Copying to an editor may overcome this issue.
768 </para>
769 </note>
770
771 <para>
772 Generate the <application>OpenJDK</application> <filename>cacerts</filename>
773 file as the <systemitem class="username">root</systemitem> user:
774 </para>
775
776<screen role="root"><userinput>if [ -f /opt/jdk/jre/lib/security/cacerts ]; then
777 mv /opt/jdk/jre/lib/security/cacerts \
778 /opt/jdk/jre/lib/security/cacerts.bak
779fi &amp;&amp;
780/opt/jdk/bin/mkcacerts \
781 -d "/etc/ssl/certs/" \
782 -k "/opt/jdk/bin/keytool" \
783 -s "/usr/bin/openssl" \
784 -o "/opt/jdk/jre/lib/security/cacerts"</userinput></screen>
785
786 <para>Use the following commands to check if the
787 <filename>cacerts</filename> file has been successfully installed:</para>
788
789<screen role="root"><userinput>cd /opt/jdk
790bin/keytool -list -keystore jre/lib/security/cacerts</userinput></screen>
791
792 <para>At the prompt "Enter keystore password:", press the "Enter" key if
793 there is no keystore password defined. If the <filename>cacerts</filename>
794 file was installed correctly, you will see a list of the certificates with
795 related information for each one. If not, you need to reinstall
796 them.</para>
797
798 </sect3>
799
800 </sect2>
801
802 <sect2 role="content">
803 <title>Contents</title>
804
805 <segmentedlist>
806 <segtitle>Installed Programs</segtitle>
807 <segtitle>Installed Libraries</segtitle>
808 <segtitle>Installed Directory</segtitle>
809
810 <seglistitem>
811 <seg>appletviewer, extcheck, idlj, jar,
812 jarsigner, java, javac, javadoc, javah, javap, java-rmi.cgi,
813 jcmd, jconsole, jdb, jdeps, jhat, jinfo, jjs, jmap, jps,
814 jrunscript, jsadebugd, jstack, jstat, jstatd, keytool, mkcacerts,
815 native2ascii, orbd, pack200, policytool, rmic, rmid, rmiregistry,
816 schemagen, serialver, servertool, tnameserv, unpack200,
817 wsgen, wsimport, and xjc</seg>
818 <seg>/opt/OpenJDK-&openjdk-version;/lib/*, and
819 /opt/OpenJDK-&openjdk-version;/jre/lib/*</seg>
820 <seg>/opt/OpenJDK-&openjdk-version;</seg>
821 </seglistitem>
822 </segmentedlist>
823
824 <variablelist>
825 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
826 <?dbfo list-presentation="list"?>
827 <?dbhtml list-presentation="table"?>
828
829 <varlistentry id="appletviewer">
830 <term><command>appletviewer</command></term>
831 <listitem>
832 <para>allows to run applets outside of a web browser.</para>
833 <indexterm zone="openjdk appletviewer">
834 <primary sortas="b-appletviewer">appletviewer</primary>
835 </indexterm>
836 </listitem>
837 </varlistentry>
838
839 <varlistentry id="extcheck">
840 <term><command>extcheck</command></term>
841 <listitem>
842 <para>checks a specified jar file for title and version conflicts
843 with any extensions installed in the
844 <application>OpenJDK</application> software.</para>
845 <indexterm zone="openjdk extcheck">
846 <primary sortas="b-extcheck">extcheck</primary>
847 </indexterm>
848 </listitem>
849 </varlistentry>
850
851 <varlistentry id="idlj">
852 <term><command>idlj</command></term>
853 <listitem>
854 <para>generates Java bindings from a given IDL file.</para>
855 <indexterm zone="openjdk idlj">
856 <primary sortas="b-idlj">idlj</primary>
857 </indexterm>
858 </listitem>
859 </varlistentry>
860
861 <varlistentry id="jar">
862 <term><command>jar</command></term>
863 <listitem>
864 <para>combines multiple files into a single jar archive.</para>
865 <indexterm zone="openjdk jar">
866 <primary sortas="b-jar">jar</primary>
867 </indexterm>
868 </listitem>
869 </varlistentry>
870
871 <varlistentry id="jarsigner">
872 <term><command>jarsigner</command></term>
873 <listitem>
874 <para>signs jar files and verifies the signatures and integrity
875 of a signed jar file.</para>
876 <indexterm zone="openjdk jarsigner">
877 <primary sortas="b-jarsigner">jarsigner</primary>
878 </indexterm>
879 </listitem>
880 </varlistentry>
881
882 <varlistentry id="java-prog">
883 <term><command>java</command></term>
884 <listitem>
885 <para>launches a Java application by starting a Java runtime
886 environment, loading a specified class and invoking its main
887 method.</para>
888 <indexterm zone="openjdk java-prog">
889 <primary sortas="b-java-prog">java</primary>
890 </indexterm>
891 </listitem>
892 </varlistentry>
893
894 <varlistentry id="javac">
895 <term><command>javac</command></term>
896 <listitem>
897 <para>reads class and interface definitions, written in the
898 Java programming language, and compiles them into bytecode
899 class files.</para>
900 <indexterm zone="openjdk javac">
901 <primary sortas="b-javac">javac</primary>
902 </indexterm>
903 </listitem>
904 </varlistentry>
905
906 <varlistentry id="javadoc">
907 <term><command>javadoc</command></term>
908 <listitem>
909 <para>parses the declarations and documentation comments in a
910 set of Java source files and produces a corresponding set of
911 HTML pages describing the classes, interfaces, constructors,
912 methods, and fields.</para>
913 <indexterm zone="openjdk javadoc">
914 <primary sortas="b-javadoc">javadoc</primary>
915 </indexterm>
916 </listitem>
917 </varlistentry>
918
919 <varlistentry id="javah">
920 <term><command>javah</command></term>
921 <listitem>
922 <para>generates C header and source files
923 that are needed to implement native methods.</para>
924 <indexterm zone="openjdk javah">
925 <primary sortas="b-javah">javah</primary>
926 </indexterm>
927 </listitem>
928 </varlistentry>
929
930 <varlistentry id="javap">
931 <term><command>javap</command></term>
932 <listitem>
933 <para>disassembles a Java class file.</para>
934 <indexterm zone="openjdk javap">
935 <primary sortas="b-javap">javap</primary>
936 </indexterm>
937 </listitem>
938 </varlistentry>
939
940 <varlistentry id="java-rmi.cgi">
941 <term><command>java-rmi.cgi</command></term>
942 <listitem>
943 <para>is the Java RMI client.</para>
944 <indexterm zone="openjdk java-rmi.cgi">
945 <primary sortas="b-java-rmi.cgi">java-rmi.cgi</primary>
946 </indexterm>
947 </listitem>
948 </varlistentry>
949
950 <varlistentry id="jcmd">
951 <term><command>jcmd</command></term>
952 <listitem>
953 <para>is a utility to send diagnostic command requests to a running
954 Java Virtual Machine.</para>
955 <indexterm zone="openjdk jcmd">
956 <primary sortas="b-jcmd">jcmd</primary>
957 </indexterm>
958 </listitem>
959 </varlistentry>
960
961 <varlistentry id="jconsole">
962 <term><command>jconsole</command></term>
963 <listitem>
964 <para>is a graphical console tool to monitor and manage both
965 local and remote Java applications and virtual machines.</para>
966 <indexterm zone="openjdk jconsole">
967 <primary sortas="b-jconsole">jconsole</primary>
968 </indexterm>
969 </listitem>
970 </varlistentry>
971
972 <varlistentry id="jdb">
973 <term><command>jdb</command></term>
974 <listitem>
975 <para>is a simple command-line debugger for Java classes.</para>
976 <indexterm zone="openjdk jdb">
977 <primary sortas="b-jdb">jdb</primary>
978 </indexterm>
979 </listitem>
980 </varlistentry>
981
982 <varlistentry id="jdeps">
983 <term><command>jdeps</command></term>
984 <listitem>
985 <para>shows the package-level or class-level dependencies of
986 Java class files.</para>
987 <indexterm zone="openjdk jdeps">
988 <primary sortas="b-jdeps">jdeps</primary>
989 </indexterm>
990 </listitem>
991 </varlistentry>
992
993 <varlistentry id="jhat">
994 <term><command>jhat</command></term>
995 <listitem>
996 <para>parses a java heap dump file and allows viewing it
997 in a web browser.</para>
998 <indexterm zone="openjdk jhat">
999 <primary sortas="b-jhat">jhat</primary>
1000 </indexterm>
1001 </listitem>
1002 </varlistentry>
1003
1004 <varlistentry id="jinfo">
1005 <term><command>jinfo</command></term>
1006 <listitem>
1007 <para>prints Java configuration information for a given Java
1008 process, core file, or a remote debug server.</para>
1009 <indexterm zone="openjdk jinfo">
1010 <primary sortas="b-jinfo">jinfo</primary>
1011 </indexterm>
1012 </listitem>
1013 </varlistentry>
1014
1015 <varlistentry id="jjs">
1016 <term><command>jjs</command></term>
1017 <listitem>
1018 <para>is a command-line tool used to invoke the Nashorn engine. It
1019 can be used to interpret one or several script files, or to run
1020 an interactive shell.</para>
1021 <indexterm zone="openjdk jjs">
1022 <primary sortas="b-jjs">jjs</primary>
1023 </indexterm>
1024 </listitem>
1025 </varlistentry>
1026
1027 <varlistentry id="jmap">
1028 <term><command>jmap</command></term>
1029 <listitem>
1030 <para>prints shared object memory maps or heap memory details
1031 of a given process, core file, or a remote debug server.</para>
1032 <indexterm zone="openjdk jmap">
1033 <primary sortas="b-jmap">jmap</primary>
1034 </indexterm>
1035 </listitem>
1036 </varlistentry>
1037
1038 <varlistentry id="jps">
1039 <term><command>jps</command></term>
1040 <listitem>
1041 <para>lists the instrumented JVMs on the target system.</para>
1042 <indexterm zone="openjdk jps">
1043 <primary sortas="b-jps">jps</primary>
1044 </indexterm>
1045 </listitem>
1046 </varlistentry>
1047
1048 <varlistentry id="jrunscript">
1049 <term><command>jrunscript</command></term>
1050 <listitem>
1051 <para>is a command line script shell.</para>
1052 <indexterm zone="openjdk jrunscript">
1053 <primary sortas="b-jrunscript">jrunscript</primary>
1054 </indexterm>
1055 </listitem>
1056 </varlistentry>
1057
1058 <varlistentry id="jsadebugd">
1059 <term><command>jsadebugd</command></term>
1060 <listitem>
1061 <para>attaches to a Java process or core file and acts as a
1062 debug server.</para>
1063 <indexterm zone="openjdk jsadebugd">
1064 <primary sortas="b-jsadebugd">jsadebugd</primary>
1065 </indexterm>
1066 </listitem>
1067 </varlistentry>
1068
1069 <varlistentry id="jstack">
1070 <term><command>jstack</command></term>
1071 <listitem>
1072 <para>prints Java stack traces of Java threads for a given
1073 Java process, core file, or a remote debug server.</para>
1074 <indexterm zone="openjdk jstack">
1075 <primary sortas="b-jstack">jstack</primary>
1076 </indexterm>
1077 </listitem>
1078 </varlistentry>
1079
1080 <varlistentry id="jstat">
1081 <term><command>jstat</command></term>
1082 <listitem>
1083 <para>displays performance statistics for an instrumented JVM.</para>
1084 <indexterm zone="openjdk jstat">
1085 <primary sortas="b-jstat">jstat</primary>
1086 </indexterm>
1087 </listitem>
1088 </varlistentry>
1089
1090 <varlistentry id="jstatd">
1091 <term><command>jstatd</command></term>
1092 <listitem>
1093 <para>is an RMI server application that monitors for the creation
1094 and termination of instrumented JVMs.</para>
1095 <indexterm zone="openjdk jstatd">
1096 <primary sortas="b-jstatd">jstatd</primary>
1097 </indexterm>
1098 </listitem>
1099 </varlistentry>
1100
1101 <varlistentry id="keytool">
1102 <term><command>keytool</command></term>
1103 <listitem>
1104 <para>is a key and certificate management utility.</para>
1105 <indexterm zone="openjdk keytool">
1106 <primary sortas="b-keytool">keytool</primary>
1107 </indexterm>
1108 </listitem>
1109 </varlistentry>
1110
1111 <varlistentry id="mkcacerts">
1112 <term><command>mkcacerts</command></term>
1113 <listitem>
1114 <para> is a simple script to extract x509 certificates and create
1115 a JRE cacerts file using <command>keytool</command>.</para>
1116 <indexterm zone="openjdk mkcacerts">
1117 <primary sortas="b-mkcacerts">mkcacerts</primary>
1118 </indexterm>
1119 </listitem>
1120 </varlistentry>
1121
1122 <varlistentry id="native2ascii">
1123 <term><command>native2ascii</command></term>
1124 <listitem>
1125 <para> converts files that contain non-supported character encoding
1126 into files containing Latin-1 or Unicode-encoded characters.</para>
1127 <indexterm zone="openjdk native2ascii">
1128 <primary sortas="b-native2ascii">native2ascii</primary>
1129 </indexterm>
1130 </listitem>
1131 </varlistentry>
1132
1133 <varlistentry id="orbd">
1134 <term><command>orbd</command></term>
1135 <listitem>
1136 <para>is used to enable clients to transparently locate and invoke
1137 persistent objects on servers in the CORBA environment.</para>
1138 <indexterm zone="openjdk orbd">
1139 <primary sortas="b-orbd">orbd</primary>
1140 </indexterm>
1141 </listitem>
1142 </varlistentry>
1143
1144 <varlistentry id="pack200">
1145 <term><command>pack200</command></term>
1146 <listitem>
1147 <para>is a Java application that transforms a jar file into a
1148 compressed pack200 file using the Java gzip compressor.</para>
1149 <indexterm zone="openjdk pack200">
1150 <primary sortas="b-pack200">pack200</primary>
1151 </indexterm>
1152 </listitem>
1153 </varlistentry>
1154
1155 <varlistentry id="policytool">
1156 <term><command>policytool</command></term>
1157 <listitem>
1158 <para>creates and manages a policy file graphically.</para>
1159 <indexterm zone="openjdk policytool">
1160 <primary sortas="b-policytool">policytool</primary>
1161 </indexterm>
1162 </listitem>
1163 </varlistentry>
1164
1165 <varlistentry id="rmic">
1166 <term><command>rmic</command></term>
1167 <listitem>
1168 <para>generates stub and skeleton class files for remote objects
1169 from the names of compiled Java classes that contain remote
1170 object implementations.</para>
1171 <indexterm zone="openjdk rmic">
1172 <primary sortas="b-rmic">rmic</primary>
1173 </indexterm>
1174 </listitem>
1175 </varlistentry>
1176
1177 <varlistentry id="rmid">
1178 <term><command>rmid</command></term>
1179 <listitem>
1180 <para>starts the activation system daemon.</para>
1181 <indexterm zone="openjdk rmid">
1182 <primary sortas="b-rmid">rmid</primary>
1183 </indexterm>
1184 </listitem>
1185 </varlistentry>
1186
1187 <varlistentry id="rmiregistry">
1188 <term><command>rmiregistry</command></term>
1189 <listitem>
1190 <para>creates and starts a remote object registry on the specified
1191 port on the current host.</para>
1192 <indexterm zone="openjdk rmiregistry">
1193 <primary sortas="b-rmiregistry">rmiregistry</primary>
1194 </indexterm>
1195 </listitem>
1196 </varlistentry>
1197
1198 <varlistentry id="schemagen">
1199 <term><command>schemagen</command></term>
1200 <listitem>
1201 <para>is a Java XML binding schema generator.</para>
1202 <indexterm zone="openjdk schemagen">
1203 <primary sortas="b-schemagen">schemagen</primary>
1204 </indexterm>
1205 </listitem>
1206 </varlistentry>
1207
1208 <varlistentry id="serialver">
1209 <term><command>serialver</command></term>
1210 <listitem>
1211 <para>returns the serialVersionUID for one or more classes in a
1212 form suitable for copying into an evolving class.</para>
1213 <indexterm zone="openjdk serialver">
1214 <primary sortas="b-serialver">serialver</primary>
1215 </indexterm>
1216 </listitem>
1217 </varlistentry>
1218
1219 <varlistentry id="servertool">
1220 <term><command>servertool</command></term>
1221 <listitem>
1222 <para>provides an ease-of-use interface for application programmers
1223 to register, unregister, startup and shutdown a server.</para>
1224 <indexterm zone="openjdk servertool">
1225 <primary sortas="b-servertool">servertool</primary>
1226 </indexterm>
1227 </listitem>
1228 </varlistentry>
1229
1230 <varlistentry id="tnameserv">
1231 <term><command>tnameserv</command></term>
1232 <listitem>
1233 <para>starts the Java IDL name server.</para>
1234 <indexterm zone="openjdk tnameserv">
1235 <primary sortas="b-tnameserv">tnameserv</primary>
1236 </indexterm>
1237 </listitem>
1238 </varlistentry>
1239
1240 <varlistentry id="unpack200">
1241 <term><command>unpack200</command></term>
1242 <listitem>
1243 <para>is a native implementation that transforms a packed file
1244 produced by <application>pack200</application> into a jar
1245 file.</para>
1246 <indexterm zone="openjdk unpack200">
1247 <primary sortas="b-unpack200">unpack200</primary>
1248 </indexterm>
1249 </listitem>
1250 </varlistentry>
1251
1252 <varlistentry id="wsgen">
1253 <term><command>wsgen</command></term>
1254 <listitem>
1255 <para>generates JAX-WS portable artifacts used in JAX-WS
1256 web services.</para>
1257 <indexterm zone="openjdk wsgen">
1258 <primary sortas="b-wsgen">wsgen</primary>
1259 </indexterm>
1260 </listitem>
1261 </varlistentry>
1262
1263 <varlistentry id="wsimport">
1264 <term><command>wsimport</command></term>
1265 <listitem>
1266 <para>generates JAX-WS portable artifacts.</para>
1267 <indexterm zone="openjdk wsimport">
1268 <primary sortas="b-wsimport">wsimport</primary>
1269 </indexterm>
1270 </listitem>
1271 </varlistentry>
1272
1273 <varlistentry id="xjc">
1274 <term><command>xjc</command></term>
1275 <listitem>
1276 <para>is a Java XML binding compiler.</para>
1277 <indexterm zone="openjdk xjc">
1278 <primary sortas="b-xjc">xjc</primary>
1279 </indexterm>
1280 </listitem>
1281 </varlistentry>
1282
1283 </variablelist>
1284
1285 </sect2>
1286
1287</sect1>
Note: See TracBrowser for help on using the repository browser.