[ac38e9dc] | 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 | <para>
|
---|
| 19 | After the package installation is complete, the next step is to make sure
|
---|
| 20 | that the system can properly find the files. If you set up your login
|
---|
| 21 | scripts as recommended in <xref linkend='postlfs-config-profile'/>, update
|
---|
| 22 | the environment by creating the <filename>openjdk.sh</filename> script,
|
---|
| 23 | as the <systemitem class="username">root</systemitem> user:
|
---|
| 24 | </para>
|
---|
| 25 |
|
---|
| 26 | <screen role="root"><userinput>cat > /etc/profile.d/openjdk.sh << "EOF"
|
---|
| 27 | <literal># Begin /etc/profile.d/openjdk.sh
|
---|
| 28 |
|
---|
| 29 | # Set JAVA_HOME directory
|
---|
| 30 | JAVA_HOME=/opt/jdk
|
---|
| 31 |
|
---|
| 32 | # Adjust PATH
|
---|
| 33 | pathappend $JAVA_HOME/bin
|
---|
| 34 |
|
---|
| 35 | # Add to MANPATH
|
---|
| 36 | pathappend $JAVA_HOME/man MANPATH
|
---|
| 37 |
|
---|
| 38 | # Auto Java CLASSPATH: Copy jar files to, or create symlinks in, the
|
---|
| 39 | # /usr/share/java directory. Note that having gcj jars with OpenJDK 8
|
---|
| 40 | # may lead to errors.
|
---|
| 41 |
|
---|
| 42 | AUTO_CLASSPATH_DIR=/usr/share/java
|
---|
| 43 |
|
---|
| 44 | pathprepend . CLASSPATH
|
---|
| 45 |
|
---|
| 46 | for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
|
---|
| 47 | pathappend $dir CLASSPATH
|
---|
| 48 | done
|
---|
| 49 |
|
---|
| 50 | for jar in `find ${AUTO_CLASSPATH_DIR} -name "*.jar" 2>/dev/null`; do
|
---|
| 51 | pathappend $jar CLASSPATH
|
---|
| 52 | done
|
---|
| 53 |
|
---|
| 54 | export JAVA_HOME
|
---|
| 55 | unset AUTO_CLASSPATH_DIR dir jar
|
---|
| 56 |
|
---|
| 57 | # End /etc/profile.d/openjdk.sh</literal>
|
---|
| 58 | EOF</userinput></screen>
|
---|
| 59 |
|
---|
| 60 | <para>
|
---|
| 61 | For allowing <command>mandb</command> to include the OpenJDK man pages
|
---|
| 62 | in its database, issue, as the <systemitem class="username">root
|
---|
| 63 | </systemitem> user:
|
---|
| 64 | </para>
|
---|
| 65 |
|
---|
| 66 | <screen role="root"><userinput>cat >> /etc/man_db.conf << "EOF" &&
|
---|
| 67 | <literal># Begin Java addition
|
---|
| 68 | MANDATORY_MANPATH /opt/jdk/man
|
---|
| 69 | MANPATH_MAP /opt/jdk/bin /opt/jdk/man
|
---|
| 70 | MANDB_MAP /opt/jdk/man /var/cache/man/jdk
|
---|
| 71 | # End Java addition</literal>
|
---|
| 72 | EOF
|
---|
| 73 |
|
---|
| 74 | mkdir -p /var/cache/man
|
---|
| 75 | mandb -c /opt/jdk/man</userinput></screen>
|
---|
| 76 |
|
---|
| 77 | <para>
|
---|
| 78 | The installation of the JRE Certificate Autority Certificates (cacerts)
|
---|
| 79 | is described in the <xref linkend="ojdk-certs"/> section.
|
---|
| 80 | If you are using the binary version, those certificates may already be
|
---|
| 81 | installed.
|
---|
| 82 | </para>
|
---|
| 83 |
|
---|
| 84 | </sect1>
|
---|