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

11.0 11.1 11.2 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 upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since eede1a3 was 45ab6c7, checked in by Xi Ruoyao <xry111@…>, 3 years ago

more SVN prop clean up

Remove "$LastChanged$" everywhere, and also some unused $Date$

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