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
Issue:
I am having a problem when I try to install a Digital Experience Collector. I am following the steps described in this link:
https://docops.ca.com/ca-experience-collector/en/installing-and-integrating-digital-experience-collector/install-the-digital-experience-collector-on-a-single-system

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

[root@myuser ExperienceCollectorBundle-2.3.0.9-2018_01_04_21_06]# ./dxc-install.sh
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-2.3.0.9-2018_01_04_21_06]# /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.
Environment:
CA Experience Collector 10.7
Java 1.8
RHEL 6.7
Cause:
The root cause is due to the OS environment variables
Resolution:
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: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz"
$ 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 dxc-install.sh script

 
Additional Information:
https://docops.ca.com/ca-experience-collector/en/installing-and-integrating-digital-experience-collector/install-the-digital-experience-collector-on-a-single-system

https://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/