source: general/prog/openjdk.xml@ 300b4ee

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

Check some office stuff. Minor fixes for some packages. Merged trunk.

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

  • Property mode set to 100644
File size: 45.9 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY 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 &lfs75_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 <ulink url="http://gnu.mirrors.pair.com/savannah/savannah/fastjar/">fastjar</ulink>,
263 <xref linkend="xorg7-lib"/>, and
264 <xref linkend="zip"/>
265 </para>
266
267 <bridgehead renderas="sect4">Recommended</bridgehead>
268 <para role="recommended">
269 <xref linkend="junit"/> and
270 <xref linkend="nss"/>
271 </para>
272
273 <bridgehead renderas="sect4">Optional</bridgehead>
274 <para role="optional">
275 <xref linkend="libxslt"/>,
276 <xref linkend="lsb-release"/>,
277 <xref linkend="mercurial"/>,
278 <xref linkend="mitkrb"/>,
279<!-- Audio support has beeen moved to icedtea-sound
280 <xref linkend="pulseaudio"/>, --> and
281 <xref linkend="xorg-server"/> (for the tests)
282 </para>
283
284 <para condition="html" role="usernotes">User Notes:
285 <ulink url="&blfs-wiki;/openjdk"/></para>
286
287 </sect2>
288
289 <sect2 role="installation">
290 <title>Installation of OpenJDK</title>
291
292 <note><para>The source build of OpenJDK requires <xref
293 linkend="apache-ant"/>. You'll need to build that first to satisfy the
294 circular dependency, and return to this section to continue building
295 OpenJDK.</para></note>
296
297 <para>Unlike other packages in BLFS, the <application>OpenJDK</application>
298 source packages are distributed in multiple downloads. Since the IcedTea
299 build harness will be used to build <application>OpenJDK</application>,
300 begin by extracting the IcedTea package and changing into the
301 extracted directory.</para>
302
303 <para>The IcedTea <application>OpenJDK</application> distribution requires
304 that <filename>js.jar</filename> (from the Rhino package) be in place in
305 order to provide a java-script implementation for the free JDK. If you have
306 not installed the js.jar file in another way, do so with the following
307 commands as the <systemitem class="username">root</systemitem> user:</para>
308
309<screen role="root"><userinput>unzip ../rhino1_7R4.zip &amp;&amp;
310install -v -d -m755 /usr/share/java &amp;&amp;
311install -v -m755 rhino1_7R4/*.jar /usr/share/java</userinput></screen>
312
313 <para>As mentioned previously, <application>OpenJDK</application> is
314 composed of several individual projects of the proprietary
315 <application>JDK</application> that have been relicensed under an open
316 source license. If you have already downloaded all of the individual
317 components, place them into the source tree with the following commands:</para>
318
319<screen><userinput>cp -v ../corba.tar.bz2 . &amp;&amp;
320cp -v ../hotspot.tar.bz2 . &amp;&amp;
321cp -v ../jaxp.tar.bz2 . &amp;&amp;
322cp -v ../jaxws.tar.bz2 . &amp;&amp;
323cp -v ../jdk.tar.bz2 . &amp;&amp;
324cp -v ../langtools.tar.bz2 . &amp;&amp;
325cp -v ../openjdk.tar.bz2 .</userinput></screen>
326
327 <para>Apply a patch to generate a valid cacerts file using the system CA
328 certificates:</para>
329
330<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-add_cacerts-1.patch</userinput></screen>
331
332 <para>Apply a patch to replace fixed paths with ones appropriate for
333 BLFS:</para>
334
335<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-fixed_paths-1.patch</userinput></screen>
336
337 <para>Apply a patch to adapt the code to the new giflib API:</para>
338
339<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-fix_new_giflib-1.patch</userinput></screen>
340
341 <para>Apply a patch to exclude known broken tests from the test suite:</para>
342
343<screen><userinput>patch -Np1 -i ../icedtea-&icedtea-version;-fix_tests-1.patch</userinput></screen>
344
345 <para>Configure and build the package with the following commands
346 (--with-pkgversion and --with-version-suffix values can be modified to fit
347 user preferences):</para>
348
349<screen><userinput>unset JAVA_HOME &amp;&amp;
350./autogen.sh &amp;&amp;
351./configure --with-jdk-home=/opt/OpenJDK-&openjdk-version;-bin \
352 --with-version-suffix=BLFS \
353 --enable-nss \
354 --disable-system-kerberos \
355 --with-parallel-jobs &amp;&amp;
356make</userinput></screen>
357
358 <note><para>If you have not installed the tarballs specified above,
359 they will be automatically downloaded here.</para></note>
360
361 <para>To test the results, issue: <command>make jtregcheck</command>. The
362 included version of <application>jtreg</application> is old, and the test
363 suite is also very dependent on the host system and the environment that it
364 is run in. You should expect to see anywhere between 40 and 100 failures in
365 jdk with up to 10 errors in the tests themselves. The majority of the
366 6000+ tests should pass. The reason for the greatly varying results is due
367 to how stringent the testing environment must be. Varying architectures,
368 different versions of dependent libraries, unexpected X Window environment
369 and window managers, the CA certificates used to generate the
370 <filename>cacerts</filename> file, and even any user input or power
371 management or screen saver interruptions during the testing can lead to
372 various failures. While the known broken tests have been removed, with the
373 fix_tests patch above, the graphics tests failures cannot be pre-determined
374 (short of removing them all). The best bet for the minimal number of
375 failures is to run the test suite in a framebuffer on a different screen
376 (Xvfb). Even still, disk I/O can cause failures.</para>
377
378<screen role='nodump'><userinput>export DISPLAY=:20 &amp;&amp;
379Xvfb :20 -screen 0 1x1x24 -ac&amp;
380echo $!> Xvfb.pid &amp;&amp;
381make -k jtregcheck &amp;&amp;
382kill -9 `cat Xvfb.pid` &amp;&amp;
383unset DISPLAY &amp;&amp;
384rm -f Xvfb.pid</userinput></screen>
385
386 <para>Install the package with the following commands as the
387 <systemitem class="username">root</systemitem> user:</para>
388
389<screen role="root"><userinput>chmod 0644 openjdk.build/j2sdk-image/lib/sa-jdi.jar &amp;&amp;
390cp -R openjdk.build/j2sdk-image /opt/OpenJDK-&openjdk-version; &amp;&amp;
391chown -R root:root /opt/OpenJDK-&openjdk-version;</userinput></screen>
392
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
486# Auto Java CLASSPATH
487# Copy jar files to, or create symlinks in this directory
488
489AUTO_CLASSPATH_DIR=/usr/share/java
490
491pathprepend . CLASSPATH
492
493for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
494 pathappend $dir CLASSPATH
495done
496
497for jar in `find ${AUTO_CLASSPATH_DIR} -name "*.jar" 2>/dev/null`; do
498 pathappend $jar CLASSPATH
499done
500
501export JAVA_HOME CLASSPATH
502unset AUTO_CLASSPATH_DIR dir jar
503
504# End /etc/profile.d/openjdk.sh</literal>
505EOF</userinput></screen>
506
507 <para>Finally, add the man pages to <application>man_db</application>'s
508 configuration. As the <systemitem class="username">root</systemitem>
509 user:</para>
510
511<screen role="root"><userinput>cat >> /etc/profile.d/extrapaths.sh &lt;&lt; "EOF" &amp;&amp;
512# Begin Java addition
513<literal>pathappend /opt/jdk/man MANPATH
514# End Java addition</literal>
515EOF
516
517
518cat &gt;&gt; /etc/man_db.conf &lt;&lt; "EOF" &amp;&amp;
519<literal># Begin Java addition
520MANDATORY_MANPATH /opt/jdk/man
521MANPATH_MAP /opt/jdk/bin /opt/jdk/man
522MANDB_MAP /opt/jdk/man /var/cache/man/jdk
523# End Java addition</literal>
524EOF
525
526mandb -c /opt/jdk/man</userinput></screen>
527
528 <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>
529
530 </sect3>
531
532 <sect3 id='ojdk-certs'>
533 <title>Install or update the JRE Certificate Authority Certificates (cacerts) file</title>
534
535 <para>Use the following procedure to check if the
536 <filename>cacerts</filename> file was successfully installed during the
537 OpenJDK build. Also, if the <xref linkend="cacerts"/> have been updated,
538 the following instructions will generate a new JRE
539 <filename>cacerts</filename> file. First, check if the
540 <filename>cacerts</filename> have been successfully installed: </para>
541
542<screen role="root"><userinput>cd /opt/jdk
543bin/keytool -list -keystore jre/lib/security/cacerts</userinput></screen>
544
545 <para>At the prompt "Enter keystore password:", press the "Enter" key if
546 there is no keystore password defined. If the
547 <filename>cacerts</filename> were installed correctly, you will see a
548 list of the certificates with related information for each one. If not,
549 you need to manually install them. First, generate the
550 <command>mkcacerts</command> script as the
551 <systemitem class="username">root</systemitem> user:</para>
552
553<screen role="root"><userinput>cat &gt; /opt/jdk/bin/mkcacerts &lt;&lt; "EOF"
554<literal>#!/bin/sh
555# Simple script to extract x509 certificates and create a JRE cacerts file.
556
557function get_args()
558 {
559 if test -z "${1}" ; then
560 showhelp
561 exit 1
562 fi
563
564 while test -n "${1}" ; do
565 case "${1}" in
566 -f | --cafile)
567 check_arg $1 $2
568 CAFILE="${2}"
569 shift 2
570 ;;
571 -d | --cadir)
572 check_arg $1 $2
573 CADIR="${2}"
574 shift 2
575 ;;
576 -o | --outfile)
577 check_arg $1 $2
578 OUTFILE="${2}"
579 shift 2
580 ;;
581 -k | --keytool)
582 check_arg $1 $2
583 KEYTOOL="${2}"
584 shift 2
585 ;;
586 -s | --openssl)
587 check_arg $1 $2
588 OPENSSL="${2}"
589 shift 2
590 ;;
591 -h | --help)
592 showhelp
593 exit 0
594 ;;
595 *)
596 showhelp
597 exit 1
598 ;;
599 esac
600 done
601 }
602
603function check_arg()
604 {
605 echo "${2}" | grep -v "^-" > /dev/null
606 if [ -z "$?" -o ! -n "$2" ]; then
607 echo "Error: $1 requires a valid argument."
608 exit 1
609 fi
610 }
611
612# The date binary is not reliable on 32bit systems for dates after 2038
613function mydate()
614 {
615 local y=$( echo $1 | cut -d" " -f4 )
616 local M=$( echo $1 | cut -d" " -f1 )
617 local d=$( echo $1 | cut -d" " -f2 )
618 local m
619
620 if [ ${d} -lt 10 ]; then d="0${d}"; fi
621
622 case $M in
623 Jan) m="01";;
624 Feb) m="02";;
625 Mar) m="03";;
626 Apr) m="04";;
627 May) m="05";;
628 Jun) m="06";;
629 Jul) m="07";;
630 Aug) m="08";;
631 Sep) m="09";;
632 Oct) m="10";;
633 Nov) m="11";;
634 Dec) m="12";;
635 esac
636
637 certdate="${y}${m}${d}"
638 }
639
640function showhelp()
641 {
642 echo "`basename ${0}` creates a valid cacerts file for use with IcedTea."
643 echo ""
644 echo " -f --cafile The path to a file containing PEM formated CA"
645 echo " certificates. May not be used with -d/--cadir."
646 echo " -d --cadir The path to a diectory of PEM formatted CA"
647 echo " certificates. May not be used with -f/--cafile."
648 echo " -o --outfile The path to the output file."
649 echo ""
650 echo " -k --keytool The path to the java keytool utility."
651 echo ""
652 echo " -s --openssl The path to the openssl utility."
653 echo ""
654 echo " -h --help Show this help message and exit."
655 echo ""
656 echo ""
657 }
658
659# Initialize empty variables so that the shell does not pollute the script
660CAFILE=""
661CADIR=""
662OUTFILE=""
663OPENSSL=""
664KEYTOOL=""
665certdate=""
666date=""
667today=$( date +%Y%m%d )
668
669# Process command line arguments
670get_args ${@}
671
672# Handle common errors
673if test "${CAFILE}x" == "x" -a "${CADIR}x" == "x" ; then
674 echo "ERROR! You must provide an x509 certificate store!"
675 echo "\'$(basename ${0}) --help\' for more info."
676 echo ""
677 exit 1
678fi
679
680if test "${CAFILE}x" != "x" -a "${CADIR}x" != "x" ; then
681 echo "ERROR! You cannot provide two x509 certificate stores!"
682 echo "\'$(basename ${0}) --help\' for more info."
683 echo ""
684 exit 1
685fi
686
687if test "${KEYTOOL}x" == "x" ; then
688 echo "ERROR! You must provide a valid keytool program!"
689 echo "\'$(basename ${0}) --help\' for more info."
690 echo ""
691 exit 1
692fi
693
694if test "${OPENSSL}x" == "x" ; then
695 echo "ERROR! You must provide a valid path to openssl!"
696 echo "\'$(basename ${0}) --help\' for more info."
697 echo ""
698 exit 1
699fi
700
701if test "${OUTFILE}x" == "x" ; then
702 echo "ERROR! You must provide a valid output file!"
703 echo "\'$(basename ${0}) --help\' for more info."
704 echo ""
705 exit 1
706fi
707
708# Get on with the work
709
710# If using a CAFILE, split it into individual files in a temp directory
711if test "${CAFILE}x" != "x" ; then
712 TEMPDIR=`mktemp -d`
713 CADIR="${TEMPDIR}"
714
715 # Get a list of staring lines for each cert
716 CERTLIST=`grep -n "^-----BEGIN" "${CAFILE}" | cut -d ":" -f 1`
717
718 # Get a list of ending lines for each cert
719 ENDCERTLIST=`grep -n "^-----END" "${CAFILE}" | cut -d ":" -f 1`
720
721 # Start a loop
722 for certbegin in `echo "${CERTLIST}"` ; do
723 for certend in `echo "${ENDCERTLIST}"` ; do
724 if test "${certend}" -gt "${certbegin}"; then
725 break
726 fi
727 done
728 sed -n "${certbegin},${certend}p" "${CAFILE}" > "${CADIR}/${certbegin}.pem"
729 keyhash=`${OPENSSL} x509 -noout -in "${CADIR}/${certbegin}.pem" -hash`
730 echo "Generated PEM file with hash: ${keyhash}."
731 done
732fi
733
734# Write the output file
735for cert in `find "${CADIR}" -type f -name "*.pem" -o -name "*.crt"`
736do
737
738 # Make sure the certificate date is valid...
739 date=$( ${OPENSSL} x509 -enddate -in "${cert}" -noout | sed 's/^notAfter=//' )
740 mydate "${date}"
741 if test "${certdate}" -lt "${today}" ; then
742 echo "${cert} expired on ${certdate}! Skipping..."
743 unset date certdate
744 continue
745 fi
746 unset date certdate
747 ls "${cert}"
748 tempfile=`mktemp`
749 certbegin=`grep -n "^-----BEGIN" "${cert}" | cut -d ":" -f 1`
750 certend=`grep -n "^-----END" "${cert}" | cut -d ":" -f 1`
751 sed -n "${certbegin},${certend}p" "${cert}" > "${tempfile}"
752 echo yes | env LC_ALL=C "${KEYTOOL}" -import -alias `basename "${cert}"` -keystore \
753 "${OUTFILE}" -storepass 'changeit' -file "${tempfile}"
754 rm "${tempfile}"
755done
756
757if test "${TEMPDIR}x" != "x" ; then
758 rm -rf "${TEMPDIR}"
759fi
760exit 0</literal>
761EOF
762
763chmod -c 0755 /opt/jdk/bin/mkcacerts</userinput></screen>
764
765 <note>
766 <para>
767 Doing a very large copy/paste directly to a terminal may result in a
768 corrupted file. Copying to an editor may overcome this issue.
769 </para>
770 </note>
771
772 <para>If you need to generate a <filename>cacerts</filename> file,
773 and there is already one in
774 <filename class="directory">/opt/jdk/jre/lib/security</filename>, it
775 is better to make a backup. Then, you can create a new one, as the
776 <systemitem class="username">root</systemitem> user:</para>
777
778<screen role="root"><userinput>/opt/jdk/bin/mkcacerts -d "/etc/ssl/certs/" -k "/opt/jdk/bin/keytool" \
779 -s "/usr/bin/openssl" -o "/opt/jdk/jre/lib/security/cacerts"</userinput></screen>
780
781 </sect3>
782
783 </sect2>
784
785 <sect2 role="content">
786 <title>Contents</title>
787
788 <segmentedlist>
789 <segtitle>Installed Programs</segtitle>
790 <segtitle>Installed Libraries</segtitle>
791 <segtitle>Installed Directory</segtitle>
792
793 <seglistitem>
794 <seg>appletviewer, apt, extcheck, idlj, jar,
795 jarsigner, java, javac, javadoc, javah, javap, java-rmi.cgi,
796 jcmd, jconsole, jdb, jhat, jinfo, jmap, jps,
797 jrunscript, jsadebugd, jstack, jstat, jstatd, keytool,
798 native2ascii, orbd, pack200, policytool, rmic, rmid, rmiregistry,
799 schemagen, serialver, servertool, tnameserv, unpack200,
800 wsgen, wsimport, and xjc</seg>
801 <seg>/opt/OpenJDK-&openjdk-version;/lib/*, and
802 /opt/OpenJDK-&openjdk-version;/jre/lib/*</seg>
803 <seg>/opt/OpenJDK-&openjdk-version;</seg>
804 </seglistitem>
805 </segmentedlist>
806
807 <variablelist>
808 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
809 <?dbfo list-presentation="list"?>
810 <?dbhtml list-presentation="table"?>
811
812 <varlistentry id="appletviewer">
813 <term><command>appletviewer</command></term>
814 <listitem>
815 <para>allows you to run applets outside of a web browser.</para>
816 <indexterm zone="openjdk appletviewer">
817 <primary sortas="b-appletviewer">appletviewer</primary>
818 </indexterm>
819 </listitem>
820 </varlistentry>
821
822 <varlistentry id="apt">
823 <term><command>apt</command></term>
824 <listitem>
825 <para>is an annotation processing tool.</para>
826 <indexterm zone="openjdk apt">
827 <primary sortas="b-apt">apt</primary>
828 </indexterm>
829 </listitem>
830 </varlistentry>
831
832 <varlistentry id="extcheck">
833 <term><command>extcheck</command></term>
834 <listitem>
835 <para>checks a specified jar file for title and version conflicts
836 with any extensions installed in the
837 <application>OpenJDK</application> software.</para>
838 <indexterm zone="openjdk extcheck">
839 <primary sortas="b-extcheck">extcheck</primary>
840 </indexterm>
841 </listitem>
842 </varlistentry>
843
844 <varlistentry id="idlj">
845 <term><command>idlj</command></term>
846 <listitem>
847 <para>generates Java bindings from a given IDL file.</para>
848 <indexterm zone="openjdk idlj">
849 <primary sortas="b-idlj">idlj</primary>
850 </indexterm>
851 </listitem>
852 </varlistentry>
853
854 <varlistentry id="jar">
855 <term><command>jar</command></term>
856 <listitem>
857 <para>combines multiple files into a single jar archive.</para>
858 <indexterm zone="openjdk jar">
859 <primary sortas="b-jar">jar</primary>
860 </indexterm>
861 </listitem>
862 </varlistentry>
863
864 <varlistentry id="jarsigner">
865 <term><command>jarsigner</command></term>
866 <listitem>
867 <para>signs jar files and verifies the signatures and integrity
868 of a signed jar file.</para>
869 <indexterm zone="openjdk jarsigner">
870 <primary sortas="b-jarsigner">jarsigner</primary>
871 </indexterm>
872 </listitem>
873 </varlistentry>
874
875 <varlistentry id="java-prog">
876 <term><command>java</command></term>
877 <listitem>
878 <para>launches a Java application by starting a Java runtime
879 environment, loading a specified class and invoking its main
880 method.</para>
881 <indexterm zone="openjdk java-prog">
882 <primary sortas="b-java-prog">java</primary>
883 </indexterm>
884 </listitem>
885 </varlistentry>
886
887 <varlistentry id="javac">
888 <term><command>javac</command></term>
889 <listitem>
890 <para>reads class and interface definitions, written in the
891 Java programming language, and compiles them into bytecode
892 class files.</para>
893 <indexterm zone="openjdk javac">
894 <primary sortas="b-javac">javac</primary>
895 </indexterm>
896 </listitem>
897 </varlistentry>
898
899 <varlistentry id="javadoc">
900 <term><command>javadoc</command></term>
901 <listitem>
902 <para>parses the declarations and documentation comments in a
903 set of Java source files and produces a corresponding set of
904 HTML pages describing the classes, interfaces,constructors,
905 methods, and fields.</para>
906 <indexterm zone="openjdk javadoc">
907 <primary sortas="b-javadoc">javadoc</primary>
908 </indexterm>
909 </listitem>
910 </varlistentry>
911
912 <varlistentry id="javah">
913 <term><command>javah</command></term>
914 <listitem>
915 <para>generates C header and source files
916 that are needed to implement native methods.</para>
917 <indexterm zone="openjdk javah">
918 <primary sortas="b-javah">javah</primary>
919 </indexterm>
920 </listitem>
921 </varlistentry>
922
923 <varlistentry id="javap">
924 <term><command>javap</command></term>
925 <listitem>
926 <para>disassembles a Java class file.</para>
927 <indexterm zone="openjdk javap">
928 <primary sortas="b-javap">javap</primary>
929 </indexterm>
930 </listitem>
931 </varlistentry>
932
933 <varlistentry id="java-rmi.cgi">
934 <term><command>java-rmi.cgi</command></term>
935 <listitem>
936 <para>is the Java RMI client.</para>
937 <indexterm zone="openjdk java-rmi.cgi">
938 <primary sortas="b-java-rmi.cgi">java-rmi.cgi</primary>
939 </indexterm>
940 </listitem>
941 </varlistentry>
942
943 <varlistentry id="jcmd">
944 <term><command>jcmd</command></term>
945 <listitem>
946 <para>is a utility to send diagnostic command requests to a running
947 Java Virtual Machine.</para>
948 <indexterm zone="openjdk jcmd">
949 <primary sortas="b-jcmd">jcmd</primary>
950 </indexterm>
951 </listitem>
952 </varlistentry>
953
954 <varlistentry id="jconsole">
955 <term><command>jconsole</command></term>
956 <listitem>
957 <para>is a graphical console tool to monitor and manage both
958 local and remote Java applications and virtual machines.</para>
959 <indexterm zone="openjdk jconsole">
960 <primary sortas="b-jconsole">jconsole</primary>
961 </indexterm>
962 </listitem>
963 </varlistentry>
964
965 <varlistentry id="jdb">
966 <term><command>jdb</command></term>
967 <listitem>
968 <para>is a simple command-line debugger for Java classes.</para>
969 <indexterm zone="openjdk jdb">
970 <primary sortas="b-jdb">jdb</primary>
971 </indexterm>
972 </listitem>
973 </varlistentry>
974
975 <varlistentry id="jhat">
976 <term><command>jhat</command></term>
977 <listitem>
978 <para>parses a java heap dump file and allows viewing
979 in a web browser.</para>
980 <indexterm zone="openjdk jhat">
981 <primary sortas="b-jhat">jhat</primary>
982 </indexterm>
983 </listitem>
984 </varlistentry>
985
986 <varlistentry id="jinfo">
987 <term><command>jinfo</command></term>
988 <listitem>
989 <para>prints Java configuration information for a given Java
990 process, core file, or a remote debug server.</para>
991 <indexterm zone="openjdk jinfo">
992 <primary sortas="b-jinfo">jinfo</primary>
993 </indexterm>
994 </listitem>
995 </varlistentry>
996
997 <varlistentry id="jmap">
998 <term><command>jmap</command></term>
999 <listitem>
1000 <para>prints shared object memory maps or heap memory details
1001 of a given process, core file, or a remote debug server.</para>
1002 <indexterm zone="openjdk jmap">
1003 <primary sortas="b-jmap">jmap</primary>
1004 </indexterm>
1005 </listitem>
1006 </varlistentry>
1007
1008 <varlistentry id="jps">
1009 <term><command>jps</command></term>
1010 <listitem>
1011 <para>lists the instrumented JVMs on the target system.</para>
1012 <indexterm zone="openjdk jps">
1013 <primary sortas="b-jps">jps</primary>
1014 </indexterm>
1015 </listitem>
1016 </varlistentry>
1017
1018 <varlistentry id="jrunscript">
1019 <term><command>jrunscript</command></term>
1020 <listitem>
1021 <para>is a command line script shell.</para>
1022 <indexterm zone="openjdk jrunscript">
1023 <primary sortas="b-jrunscript">jrunscript</primary>
1024 </indexterm>
1025 </listitem>
1026 </varlistentry>
1027
1028 <varlistentry id="jsadebugd">
1029 <term><command>jsadebugd</command></term>
1030 <listitem>
1031 <para>attaches to a Java process or core file and acts as a
1032 debug server.</para>
1033 <indexterm zone="openjdk jsadebugd">
1034 <primary sortas="b-jsadebugd">jsadebugd</primary>
1035 </indexterm>
1036 </listitem>
1037 </varlistentry>
1038
1039 <varlistentry id="jstack">
1040 <term><command>jstack</command></term>
1041 <listitem>
1042 <para>prints Java stack traces of Java threads for a given
1043 Java process, core file, or a remote debug server.</para>
1044 <indexterm zone="openjdk jstack">
1045 <primary sortas="b-jstack">jstack</primary>
1046 </indexterm>
1047 </listitem>
1048 </varlistentry>
1049
1050 <varlistentry id="jstat">
1051 <term><command>jstat</command></term>
1052 <listitem>
1053 <para>displays performance statistics for an instrumented JVM.</para>
1054 <indexterm zone="openjdk jstat">
1055 <primary sortas="b-jstat">jstat</primary>
1056 </indexterm>
1057 </listitem>
1058 </varlistentry>
1059
1060 <varlistentry id="jstatd">
1061 <term><command>jstatd</command></term>
1062 <listitem>
1063 <para>is an RMI server application that monitors for the creation
1064 and termination of instrumented JVMs.</para>
1065 <indexterm zone="openjdk jstatd">
1066 <primary sortas="b-jstatd">jstatd</primary>
1067 </indexterm>
1068 </listitem>
1069 </varlistentry>
1070
1071 <varlistentry id="keytool">
1072 <term><command>keytool</command></term>
1073 <listitem>
1074 <para>is a key and certificate management utility.</para>
1075 <indexterm zone="openjdk keytool">
1076 <primary sortas="b-keytool">keytool</primary>
1077 </indexterm>
1078 </listitem>
1079 </varlistentry>
1080
1081 <varlistentry id="native2ascii">
1082 <term><command>native2ascii</command></term>
1083 <listitem>
1084 <para> converts files that contain non-supported character encoding
1085 into files containing Latin-1 or Unicode-encoded characters.</para>
1086 <indexterm zone="openjdk native2ascii">
1087 <primary sortas="b-native2ascii">native2ascii</primary>
1088 </indexterm>
1089 </listitem>
1090 </varlistentry>
1091
1092 <varlistentry id="orbd">
1093 <term><command>orbd</command></term>
1094 <listitem>
1095 <para>is used to enable clients to transparently locate and invoke
1096 persistent objects on servers in the CORBA environment.</para>
1097 <indexterm zone="openjdk orbd">
1098 <primary sortas="b-orbd">orbd</primary>
1099 </indexterm>
1100 </listitem>
1101 </varlistentry>
1102
1103 <varlistentry id="pack200">
1104 <term><command>pack200</command></term>
1105 <listitem>
1106 <para>is a Java application that transforms a jar file into a
1107 compressed pack200 file using the Java gzip compressor.</para>
1108 <indexterm zone="openjdk pack200">
1109 <primary sortas="b-pack200">pack200</primary>
1110 </indexterm>
1111 </listitem>
1112 </varlistentry>
1113
1114 <varlistentry id="policytool">
1115 <term><command>policytool</command></term>
1116 <listitem>
1117 <para>creates and manages a policy file graphically.</para>
1118 <indexterm zone="openjdk policytool">
1119 <primary sortas="b-policytool">policytool</primary>
1120 </indexterm>
1121 </listitem>
1122 </varlistentry>
1123
1124 <varlistentry id="rmic">
1125 <term><command>rmic</command></term>
1126 <listitem>
1127 <para>generates stub and skeleton class files for remote objects
1128 from the names of compiled Java classes that contain remote
1129 object implementations.</para>
1130 <indexterm zone="openjdk rmic">
1131 <primary sortas="b-rmic">rmic</primary>
1132 </indexterm>
1133 </listitem>
1134 </varlistentry>
1135
1136 <varlistentry id="rmid">
1137 <term><command>rmid</command></term>
1138 <listitem>
1139 <para>starts the activation system daemon.</para>
1140 <indexterm zone="openjdk rmid">
1141 <primary sortas="b-rmid">rmid</primary>
1142 </indexterm>
1143 </listitem>
1144 </varlistentry>
1145
1146 <varlistentry id="rmiregistry">
1147 <term><command>rmiregistry</command></term>
1148 <listitem>
1149 <para>creates and starts a remote object registry on the specified
1150 port on the current host.</para>
1151 <indexterm zone="openjdk rmiregistry">
1152 <primary sortas="b-rmiregistry">rmiregistry</primary>
1153 </indexterm>
1154 </listitem>
1155 </varlistentry>
1156
1157 <varlistentry id="schemagen">
1158 <term><command>schemagen</command></term>
1159 <listitem>
1160 <para>is a Java XML binding schema generator.</para>
1161 <indexterm zone="openjdk schemagen">
1162 <primary sortas="b-schemagen">schemagen</primary>
1163 </indexterm>
1164 </listitem>
1165 </varlistentry>
1166
1167 <varlistentry id="serialver">
1168 <term><command>serialver</command></term>
1169 <listitem>
1170 <para>returns the serialVersionUID for one or more classes in a
1171 form suitable for copying into an evolving class.</para>
1172 <indexterm zone="openjdk serialver">
1173 <primary sortas="b-serialver">serialver</primary>
1174 </indexterm>
1175 </listitem>
1176 </varlistentry>
1177
1178 <varlistentry id="servertool">
1179 <term><command>servertool</command></term>
1180 <listitem>
1181 <para>provides an ease-of-use interface for application programmers
1182 to register, unregister, startup and shutdown a server.</para>
1183 <indexterm zone="openjdk servertool">
1184 <primary sortas="b-servertool">servertool</primary>
1185 </indexterm>
1186 </listitem>
1187 </varlistentry>
1188
1189 <varlistentry id="tnameserv">
1190 <term><command>tnameserv</command></term>
1191 <listitem>
1192 <para>starts the Java IDL name server.</para>
1193 <indexterm zone="openjdk tnameserv">
1194 <primary sortas="b-tnameserv">tnameserv</primary>
1195 </indexterm>
1196 </listitem>
1197 </varlistentry>
1198
1199 <varlistentry id="unpack200">
1200 <term><command>unpack200</command></term>
1201 <listitem>
1202 <para>is a native implementation that transforms a packed file
1203 produced by <application>pack200</application> into a jar
1204 file.</para>
1205 <indexterm zone="openjdk unpack200">
1206 <primary sortas="b-unpack200">unpack200</primary>
1207 </indexterm>
1208 </listitem>
1209 </varlistentry>
1210
1211 <varlistentry id="wsgen">
1212 <term><command>wsgen</command></term>
1213 <listitem>
1214 <para>generates JAX-WS portable artifacts used in JAX-WS
1215 web services.</para>
1216 <indexterm zone="openjdk wsgen">
1217 <primary sortas="b-wsgen">wsgen</primary>
1218 </indexterm>
1219 </listitem>
1220 </varlistentry>
1221
1222 <varlistentry id="wsimport">
1223 <term><command>wsimport</command></term>
1224 <listitem>
1225 <para>generates JAX-WS portable artifacts.</para>
1226 <indexterm zone="openjdk wsimport">
1227 <primary sortas="b-wsimport">wsimport</primary>
1228 </indexterm>
1229 </listitem>
1230 </varlistentry>
1231
1232 <varlistentry id="xjc">
1233 <term><command>xjc</command></term>
1234 <listitem>
1235 <para>is a Java XML binding compiler.</para>
1236 <indexterm zone="openjdk xjc">
1237 <primary sortas="b-xjc">xjc</primary>
1238 </indexterm>
1239 </listitem>
1240 </varlistentry>
1241
1242 </variablelist>
1243
1244 </sect2>
1245
1246</sect1>
Note: See TracBrowser for help on using the repository browser.