source: general/prog/openjdk.xml@ ef5eb8e

7.6-blfs 7.6-systemd kde5-14269 kde5-14686 systemd-13485
Last change on this file since ef5eb8e was ef5eb8e, checked in by Krejzi <krejzi@…>, 10 years ago

Let other packages find java headers.

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

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