Index: general/prog/apache-ant.xml
===================================================================
--- general/prog/apache-ant.xml	(revision 8ddea36ec016888ed5d7547e42c2b24428e766bb)
+++ general/prog/apache-ant.xml	(revision 58cba7f0df711f0ad067a21458a0de53b0c1f682)
@@ -208,11 +208,17 @@
 
       <para>Some packages will require <command>ant</command> to be in the
-      search path and the <envar>$ANT_HOME</envar> environment variable
-      defined. Satisfy these requirements by adding the following lines to
-      <filename>/etc/profile</filename> or to individual user's
-      <filename>~/.profile</filename> or <filename>~/.bashrc</filename> files:</para>
-
-<screen><literal>export PATH=$PATH:/opt/ant/bin
-export ANT_HOME=/opt/ant</literal></screen>
+      search path and the <envar>ANT_HOME</envar> environment variable
+      defined. Satisfy these requirements by issuing, as the <systemitem
+      class="username">root</systemitem> user:</para>
+
+<screen role="root"><userinput>cat &gt;&gt; /etc/profile.d/extrapaths.sh &lt;&lt; EOF
+<literal># Begin Apache-ant addition
+pathappend /opt/ant/bin
+export ANT_HOME=/opt/ant
+# End Apache-ant addition</literal>
+EOF</userinput></screen>
+
+      <para>The above instrutions assume you have configured your system as
+      described in <xref linkend="postlfs-config-profile"/>.</para>
 
     </sect3>
Index: general/prog/java.xml
===================================================================
--- general/prog/java.xml	(revision 8ddea36ec016888ed5d7547e42c2b24428e766bb)
+++ general/prog/java.xml	(revision 58cba7f0df711f0ad067a21458a0de53b0c1f682)
@@ -137,4 +137,5 @@
 chown -R root:root /opt/OpenJDK-&openjdk-version;-bin</userinput></screen>
 
+<!--
     <para>Configure the temporary <application>OpenJDK</application>
     installation by issuing the following commands (note that if you logout
@@ -150,10 +151,25 @@
     logout and login back, or to source the profile file after
     modification.</para>
+-->
 
+    <para>
+      The binary version is now installed. You may create a symlink to that
+      version by issuing, as the <systemitem class="username">root</systemitem>
+      user:
+    </para>
 
-    <para>The binary version is now installed. If you don't want to compile the
-    sources, skip ahead to the <xref linkend='openjdk-config'/> section.
+<screen role="root"><userinput>ln -sf OpenJDK-&openjdk-version;-bin /opt/jdk</userinput></screen>
+
+    <para>
+      You may now proceed to <xref linkend="ojdk-conf"/>, where the
+      instructions assume that the above link exists.
+    </para>
+
+<!--
+If you don't want to compile the
+      sources, skip ahead to the <xref linkend='openjdk-config'/> section.
     Otherwise, continue to the <xref linkend='apache-ant'/>,
     <xref linkend='junit'/>, and <xref linkend='openjdk'/> sections.</para>
+-->
     
   </sect2>
Index: general/prog/junit.xml
===================================================================
--- general/prog/junit.xml	(revision 8ddea36ec016888ed5d7547e42c2b24428e766bb)
+++ general/prog/junit.xml	(revision 58cba7f0df711f0ad067a21458a0de53b0c1f682)
@@ -126,8 +126,9 @@
     
     <para>
-      Finally, update the <envar>CLASSPATH</envar> variable:
+      If you have followed the instructions in <xref linkend="ojdk-conf"/>,
+      there is nothing more to do: the <envar>CLASSPATH</envar> variable
+      whould be automatically updated.
     </para>
 
-<screen><userinput>export CLASSPATH=$CLASSPATH:/usr/share/java/junit-&junit-version;</userinput></screen>
   </sect2>
 
Index: general/prog/ojdk-conf.xml
===================================================================
--- general/prog/ojdk-conf.xml	(revision 58cba7f0df711f0ad067a21458a0de53b0c1f682)
+++ general/prog/ojdk-conf.xml	(revision 58cba7f0df711f0ad067a21458a0de53b0c1f682)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../../general.ent">
+  %general-entities;
+]>
+
+<sect1 id="ojdk-conf" xreflabel="Configuring the JAVA environment">
+  <?dbhtml filename="ojdk-conf.html"?>
+
+  <sect1info>
+    <othername>$LastChangedBy$</othername>
+    <date>$Date$</date>
+  </sect1info>
+
+  <title>Configuring the JAVA environment</title>
+
+    <para>
+      After the package installation is complete, the next step is to make sure
+      that the system can properly find the files.  If you set up your login
+      scripts as recommended in <xref linkend='postlfs-config-profile'/>, update
+      the environment by creating the <filename>openjdk.sh</filename> script,
+      as the <systemitem class="username">root</systemitem> user:
+    </para>
+
+<screen role="root"><userinput>cat &gt; /etc/profile.d/openjdk.sh &lt;&lt; "EOF"
+<literal># Begin /etc/profile.d/openjdk.sh
+
+# Set JAVA_HOME directory
+JAVA_HOME=/opt/jdk
+
+# Adjust PATH
+pathappend $JAVA_HOME/bin
+
+# Add to MANPATH
+pathappend $JAVA_HOME/man MANPATH
+
+# Auto Java CLASSPATH: Copy jar files to, or create symlinks in, the
+# /usr/share/java directory. Note that having gcj jars with OpenJDK 8
+# may lead to errors.
+
+AUTO_CLASSPATH_DIR=/usr/share/java
+
+pathprepend . CLASSPATH
+
+for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
+    pathappend $dir CLASSPATH
+done
+
+for jar in `find ${AUTO_CLASSPATH_DIR} -name "*.jar" 2>/dev/null`; do
+    pathappend $jar CLASSPATH
+done
+
+export JAVA_HOME
+unset AUTO_CLASSPATH_DIR dir jar
+
+# End /etc/profile.d/openjdk.sh</literal>
+EOF</userinput></screen>
+
+    <para>
+      For allowing <command>mandb</command> to include the OpenJDK man pages
+      in its database, issue, as the <systemitem class="username">root
+      </systemitem> user:
+    </para>
+
+<screen role="root"><userinput>cat &gt;&gt; /etc/man_db.conf &lt;&lt; "EOF" &amp;&amp;
+<literal># Begin Java addition
+MANDATORY_MANPATH     /opt/jdk/man
+MANPATH_MAP           /opt/jdk/bin     /opt/jdk/man
+MANDB_MAP             /opt/jdk/man     /var/cache/man/jdk
+# End Java addition</literal>
+EOF
+
+mkdir -p /var/cache/man
+mandb -c /opt/jdk/man</userinput></screen>
+
+    <para>
+      The installation of the JRE Certificate Autority Certificates (cacerts)
+      is described in the <xref linkend="ojdk-certs"/> section.
+      If you are using the binary version, those certificates may already be
+      installed.
+    </para>
+
+</sect1>
Index: general/prog/openjdk.xml
===================================================================
--- general/prog/openjdk.xml	(revision 8ddea36ec016888ed5d7547e42c2b24428e766bb)
+++ general/prog/openjdk.xml	(revision 58cba7f0df711f0ad067a21458a0de53b0c1f682)
@@ -454,4 +454,15 @@
 chown -R root:root /opt/OpenJDK-&openjdk-version;</userinput></screen>
 
+    <para>
+      There are now two <application>OpenJDK</application> SDKs installed
+      in <filename class="directory">/opt</filename>. You should decide on
+      which one you would like to use as the default. Normally, you would opt
+      for the just installed <application>OpenJDK</application>. If so, do
+      the following as the <systemitem class="username">root</systemitem>
+      user:
+    </para>
+
+<screen role="root"><userinput>ln -v -nsf OpenJDK-&openjdk-version; /opt/jdk</userinput></screen>
+
     <para>If desired, you may install a .desktop file corresponding to an entry
     in a desktop menu for <command>policytool</command>. First, you need to
@@ -575,81 +586,8 @@
       <title>Configuration Information</title>
 
-      <para>
-        There are now two <application>OpenJDK</application> SDKs installed
-        in <filename class="directory">/opt</filename>. You should decide on
-        which one you would like to use as the default. For example if you
-        decide to use the precompiled <application>OpenJDK</application>, do
-        the following as the <systemitem class="username">root</systemitem>
-        user:
-      </para>
-
-<screen role="root"><userinput>ln -v -nsf OpenJDK-&openjdk-version;-bin /opt/jdk</userinput></screen>
-
-      <para>The information below assumes your system is set up using the
-      instructions found in <quote><xref
-      linkend="postlfs-config-profile"/></quote>. You may need to extract the
-      relevant information below and incorporate it into your system's startup
-      files if your system is set up differently.</para>
-
-      <para>Add the following <filename>openjdk.sh</filename> shell startup
-      file to the <filename>/etc/profile.d</filename> directory with the
-      following commands as the <systemitem class="username">root</systemitem>
-      user:</para>
-
-<screen role="root"><userinput>cat &gt; /etc/profile.d/openjdk.sh &lt;&lt; "EOF"
-<literal># Begin /etc/profile.d/openjdk.sh
-
-# Set JAVA_HOME directory
-JAVA_HOME=/opt/jdk
-
-# Set ANT_HOME directory
-ANT_HOME=/opt/ant
-
-# Adjust PATH
-pathappend $JAVA_HOME/bin PATH
-pathappend $ANT_HOME/bin PATH
-
-# Auto Java CLASSPATH
-# Copy jar files to, or create symlinks in this directory
-
-AUTO_CLASSPATH_DIR=/usr/share/java
-
-pathprepend . CLASSPATH
-
-for dir in `find ${AUTO_CLASSPATH_DIR} -type d 2>/dev/null`; do
-    pathappend $dir CLASSPATH
-done
-
-for jar in `find ${AUTO_CLASSPATH_DIR} -name "*.jar" 2>/dev/null`; do
-    pathappend $jar CLASSPATH
-done
-
-export JAVA_HOME ANT_HOME CLASSPATH
-unset AUTO_CLASSPATH_DIR dir jar
-
-# End /etc/profile.d/openjdk.sh</literal>
-EOF</userinput></screen>
-
-    <para>Finally, add the man pages to <application>man_db</application>'s
-    configuration. As the <systemitem class="username">root</systemitem>
-    user:</para>
-
-<screen role="root"><userinput>cat >> /etc/profile.d/extrapaths.sh &lt;&lt; "EOF" &amp;&amp;
-<literal># Begin Java addition
-pathappend /opt/jdk/man       MANPATH
-# End Java addition</literal>
-EOF
-
-
-cat &gt;&gt; /etc/man_db.conf &lt;&lt; "EOF" &amp;&amp;
-<literal># Begin Java addition
-MANDATORY_MANPATH     /opt/jdk/man
-MANPATH_MAP           /opt/jdk/bin     /opt/jdk/man
-MANDB_MAP             /opt/jdk/man     /var/cache/man/jdk
-# End Java addition</literal>
-EOF
-
-mkdir -p /var/cache/man
-mandb -c /opt/jdk/man</userinput></screen>
+    <para>Normally, the JAVA environment has been configured after installing
+    the binary version, and can be used with the just built package as well.
+    Review <xref linkend="ojdk-conf"/> in case you want to modify
+    something.</para>
 
     <para>To test if the man pages are correctly installed, issue
@@ -659,5 +597,5 @@
     </sect3>
 
-    <sect3 id='ojdk-certs'>
+    <sect3 id='ojdk-certs' xreflabel='JRE Certificate Authorithy Certificates'>
       <title>Install or update the JRE Certificate Authority Certificates
       (cacerts) file</title>
Index: general/prog/prog.xml
===================================================================
--- general/prog/prog.xml	(revision 8ddea36ec016888ed5d7547e42c2b24428e766bb)
+++ general/prog/prog.xml	(revision 58cba7f0df711f0ad067a21458a0de53b0c1f682)
@@ -66,7 +66,8 @@
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dummy-java.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="java.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="openjdk.xml"/>
+  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ojdk-conf.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apache-ant.xml"/>
   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="junit.xml"/>
-  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="openjdk.xml"/>
 
 </chapter>
Index: introduction/welcome/changelog.xml
===================================================================
--- introduction/welcome/changelog.xml	(revision 8ddea36ec016888ed5d7547e42c2b24428e766bb)
+++ introduction/welcome/changelog.xml	(revision 58cba7f0df711f0ad067a21458a0de53b0c1f682)
@@ -48,4 +48,9 @@
       <para>March 4th, 2015</para>
       <itemizedlist>
+        <listitem>
+          <para>[pierre] - Split the JAVA environment configuration from
+          the other pages. Put the Apache-ant and JUnit pages
+          after OpenJDK, since they are not needed anymore for OpenJDK.</para>
+        </listitem>
         <listitem>
           <para>[fernando] - Fix Xorg-Server-1.17.1: do not build
