GMU unable to find JAVA JAVA_HOME
search cancel

GMU unable to find JAVA JAVA_HOME

book

Article ID: 255341

calendar_today

Updated On:

Products

CA Mobile API Gateway

Issue/Introduction

We are using GMU 1.5.00-479 tool and trying to run the packages from our AWS Red Hat Enterprise Linux Server 7.9 (Maipo) instances and seeing below error. 

[GatewayMigrationUtility-1.5.00-479]$ ./GatewayMigrationUtility.sh
Please ensure "java" is in the PATH, set JAVA_HOME or run with --jdk option.

We compared the Java paths with our current working environment as well but not sure the reason for above errors.

Here are some outputs from server.

 $which java
/opt/ca/jdk/bin/java

$ echo $JAVA_HOME
/opt/ca/jdk

 $echo $PATH
/opt/ca/jdk/bin:/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/amp/home/apigwe2/.local/bin:/amp/home/apigwe2/bin

 

Environment

Release : 7.1

Cause

Issue is with the shell being used

 

Resolution

The easiest way to resolve this is to modify the script with the JAVA_HOME variable for your system path of java

Windows BATCH file GatewayMigrationUtility.bat

@echo OFF

set JAVA_HOME=C:\Program Files\Java\jdk-11.0.15

 

Unix script:  GatewayMigrationUtility.sh

#!/bin/bash

#

# Script to launch the CommandlineMigrationClient.jar

#

JAVA_HOME=/opt/JDK

export JAVA_HOME