Pivotal Knowledge Base


Java version validation failed and fail to find java command in PATH


Pivotal GPText less than 2.1.1

OS: RHEL 6.x


When attempting to install the GPText binary it fails with an error message mentioning that the process failed to find the java command in the PATH environment variable. This can be seen in environments where a non-oracle Java JRE is in the PATH environment variable.

[CRITICAL]:-Installation failed: Java version validation failed on xxxx.xxxx. Failed to find java command in PATH.


In versions lower than 2.1.1 this can happen for two different reasons:

1. There is no java binary in the PATH environment variable.

[gpadmin@gpdb ~]$ java -version
-bash: java: command not found

2. There is an OpenJDK java version in the PATH environment variable. GPText requires Oracle JDK 1.8.x.

[gpadmin@gpdb ~]$ java -version
openjdk version "1.8.0_45"
OpenJDK Runtime Environment (build 1.8.0_45-b13)
OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)

Note: In the 2.1.1 version, a new parameter called GPTEXT_JAVA_HOME has been introduced that gives the possibility to have a different java version set up in the PATH environment variable. 


Install the Oracle JDK 1.8.x and include in the PATH environment variable. The following script can be used to install Oracle JDK 1.8.0_1.3.1 and include it in the path: 

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/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz"
tar xzf jdk-8u131-linux-x64.tar.gz
rm -rf /opt/jdk-8u131-linux-x64.tar.gz

cd /opt/jdk1.8.0_131/
alternatives --install /usr/bin/java java /opt/jdk1.8.0_131/bin/java 2

eval java -version

export JAVA_HOME=/opt/jdk1.8.0_131
export JRE_HOME=/opt/jdk1.8.0_131/jre
export PATH=$PATH:/opt/jdk1.8.0_131/bin:/opt/jdk1.8.0_131/jre/bin >>>> .bashrc

Additional Information

[1] http://gptext.docs.pivotal.io/210/topics/installing.html

[2] http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html


Powered by Zendesk