source: general/prog/ojdk-conf.xml@ 55bcdd7

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt 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 55bcdd7 was 55bcdd7, checked in by Pierre Labastie <pieere@…>, 6 years ago

Move the instructions to install the JAVA CA certificates to "Configuring the
JAVA environment" and host jtreg on anduin.

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

  • Property mode set to 100644
File size: 4.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
8<sect1 id="ojdk-conf" xreflabel="Configuring the JAVA environment">
9 <?dbhtml filename="ojdk-conf.html"?>
10
11 <sect1info>
12 <othername>$LastChangedBy$</othername>
13 <date>$Date$</date>
14 </sect1info>
15
16 <title>Configuring the JAVA environment</title>
17
18 <sect2 id="java-profile">
19 <title>Setting up the environment</title>
20
21 <para>
22 After the package installation is complete, the next step is to make sure
23 that the system can properly find the files. If you set up your login
24 scripts as recommended in <xref linkend='postlfs-config-profile'/>, update
25 the environment by creating the <filename>openjdk.sh</filename> script,
26 as the <systemitem class="username">root</systemitem> user:
27 </para>
28
29<screen role="root"><userinput>cat &gt; /etc/profile.d/openjdk.sh &lt;&lt; "EOF"
30<literal># Begin /etc/profile.d/openjdk.sh
31
32# Set JAVA_HOME directory
33JAVA_HOME=/opt/jdk
34
35# Adjust PATH
36pathappend $JAVA_HOME/bin
37
38# Add to MANPATH
39pathappend $JAVA_HOME/man MANPATH
40
41# Auto Java CLASSPATH: Copy jar files to, or create symlinks in, the
42# /usr/share/java directory. Note that having gcj jars with OpenJDK 8
43# may lead to errors.
44
45AUTO_CLASSPATH_DIR=/usr/share/java
46
47pathprepend . CLASSPATH
48
49for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
50 pathappend $dir CLASSPATH
51done
52
53for jar in `find ${AUTO_CLASSPATH_DIR} -name "*.jar" 2>/dev/null`; do
54 pathappend $jar CLASSPATH
55done
56
57export JAVA_HOME
58unset AUTO_CLASSPATH_DIR dir jar
59
60# End /etc/profile.d/openjdk.sh</literal>
61EOF</userinput></screen>
62
63 <para>
64 For allowing <command>mandb</command> to include the OpenJDK man pages
65 in its database, issue, as the <systemitem class="username">root
66 </systemitem> user:
67 </para>
68
69<screen role="root"><userinput>cat &gt;&gt; /etc/man_db.conf &lt;&lt; "EOF" &amp;&amp;
70<literal># Begin Java addition
71MANDATORY_MANPATH /opt/jdk/man
72MANPATH_MAP /opt/jdk/bin /opt/jdk/man
73MANDB_MAP /opt/jdk/man /var/cache/man/jdk
74# End Java addition</literal>
75EOF
76
77mkdir -p /var/cache/man
78mandb -c /opt/jdk/man</userinput></screen>
79
80 </sect2>
81
82 <sect2 id="ojdk-certs" xreflabel="installing the JVM Certificate Authority Certificates">
83
84 <title>Setting up the Certificate Authority Certificates for Java</title>
85
86 <para>
87 <application>OpenJDK</application> uses its own format for the
88 CA certificates. The Java security modules use
89 <envar>$JAVA_HOME</envar><filename>/lib/security/cacerts</filename> by
90 default. In order to keep all the certificates in one place, we use
91 <filename>/etc/ssl/java/cacerts.jks</filename>. That file should be
92 generated using the system PKI trust store. The instructions
93 on the <xref linkend="make-ca"/> page should be used to update the file
94 located in <filename class="directory">/etc/ssl/java</filename>.
95 Run the conversion and setup a symlink in the default location as the
96 <systemitem class="username">root</systemitem> user:
97 </para>
98
99<screen role="root"><userinput>/usr/sbin/make-ca -g --force &amp;&amp;
100ln -sfv /etc/ssl/java/cacerts.jks /opt/jdk/lib/security/cacerts</userinput></screen>
101
102 <para>
103 Use the following commands to check if the <filename>cacerts</filename>
104 file has been successfully installed:
105 </para>
106
107<screen role="root"><userinput>cd /opt/jdk
108bin/keytool -list -cacerts</userinput></screen>
109
110 <para>
111 At the prompt <computeroutput>Enter keystore password:</computeroutput>,
112 enter <userinput>changeit</userinput> (the default) or just press the
113 <quote>Enter</quote> key. If the <filename>cacerts</filename> file was
114 installed correctly, you will see a list of the certificates with
115 related information for each one. If not, you need to reinstall them.
116 </para>
117
118 <para>
119 If you later install a new JVM, you just have to create the symlink in
120 the default location to be able to use the cacerts.
121 </para>
122
123 </sect2>
124
125</sect1>
Note: See TracBrowser for help on using the repository browser.