source: general/prog/ojdk-conf.xml@ 7c6b211

11.2 plabs/python-mods qt5new trunk xry111/soup3
Last change on this file since 7c6b211 was 7c6b211, checked in by Douglas R. Reno <renodr@…>, 6 months ago

Update to OpenJDK-18.0.2. The i686 binary will come later today or
tomorrow.

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