source: general/prog/openjdk.xml@ a8bf989f

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 a8bf989f was 20f09631, checked in by Fernando de Oliveira <fernando@…>, 8 years ago
  • Update to GNOME-3.18.2.
  • Update to libpng-1.6.19.
  • Update to ffmpeg-2.8.2.
  • FFmpeg-2.8.1 does not build with libvpx-1.5.0. same holds for 2.8.2
  • xinit: Nothing has to be anything less yet "nodump".
  • libreoffice: reinstate what should not have been deleted and include verbose, because I like.
  • LXQt pre-install instructions: I do want extra lines here, although who modified implied that they were so bad instructions and he was only trying to improve.
  • openjdk: as agreed but not done, make test suite optional.

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

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