Persistent error "require java version 1.8 or higher" when installing Digital Experience Collector

Document ID : KB000097913
Last Modified Date : 22/06/2018
Show Technical Document Details
I am having a problem when I try to install a Digital Experience Collector. I am following the steps described in this link:

When I try to execute the ./ script, it shows the following java error:

[root@myuser ExperienceCollectorBundle-]# ./
Step 1: Checking java version
...found java executable in /ctmagent/ctm/JRE/
...require java version 1.8 or higher

But if you check the version of that java, you can see it is a 1.8 version or higher:

[root@myuser ExperienceCollectorBundle-]# /ctmagent/ctm/JRE/bin/java -version
java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

It is a valid version to perform the installation, so I don´t know why that error message is being shown.
CA Experience Collector 10.7
Java 1.8
RHEL 6.7
The root cause is due to the OS environment variables
By making sure JAVA 1.8 is in place and by configuring the environment variables should resolve this issue.
Please follow below steps:

a.- Download Java 8
$ cd /opt/
$wget --no-cookies --no-check-certificate --header "Cookie:; oraclelicense=accept-securebackup-cookie" ""
$ tar xzf jdk-8u171-linux-x64.tar.gz

b.- Install Java 8 with Alternatives
$ cd /opt/jdk1.8.0_171/
$ alternatives --install /usr/bin/java java /opt/jdk1.8.0_171/bin/java 2
$ alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
*  1           /opt/jdk1.7.0_71/bin/java
 + 2           /opt/jdk1.8.0_45/bin/java
   3           /opt/jdk1.8.0_171/bin/java

Enter to keep the current selection[+], or type selection number: 3

Enter "3" and hit Enter to select java 1.8.0_171.

c.- Setup Java Environment Variables
$ export JAVA_HOME=/opt/jdk1.8.0_171
$ export JRE_HOME=/opt/jdk1.8.0_171/jre
$ export PATH=$PATH:/opt/jdk1.8.0_171/bin:/opt/jdk1.8.0_171/jre/bin

d.- Launch script

Additional Information: