source: general/prog/ojdk-conf.xml@ eb19100e

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since eb19100e was 3f2db3a6, checked in by Pierre Labastie <pierre.labastie@…>, 17 months ago

Remove sect1info tags

They only contain a date tag that is nowhere used.

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