source: general/prog/openjdk.xml@ 3c39513

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 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 3c39513 was 0da9f15, checked in by Pierre Labastie <pieere@…>, 8 years ago

Update figures for openjdk. Forgot in the last update.

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

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