source: general/prog/openjdk.xml@ 7ea4cb6

10.0 10.1 11.0 7.10 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind ken/refactor-virt lazarus nosym perl-modules qt5new trunk upgradedb xry111/git-date xry111/git-date-for-trunk xry111/git-date-test
Last change on this file since 7ea4cb6 was 7ea4cb6, checked in by Pierre Labastie <pieere@…>, 6 years ago

OpenJDK-1.8.0.77

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

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