ERROR: JRE_HOME environment variable is not defined correctly running service.bat install 
search cancel

ERROR: JRE_HOME environment variable is not defined correctly running service.bat install 

book

Article ID: 282126

calendar_today

Updated On:

Products

Output Management Web Viewer

Issue/Introduction

After applying the maintenance for Tomcat 9.0.84 and getting "non fatal error" then entering this command in the Administrator command prompt:

E:\Program Files\CA\CA_OM_Web_Viewer\apache-tomcat-9.0.84\bin>service.bat install tomcat9084
Got the following error message:

E:\Program Files\CA_OM_Web Viewer\apache-tomcat-9.0.84\bin>rem--------------------
The JRE_HOME environment variable is not defined correctly 
JRE_HOME=E:\Program Files\Java OPENjdk\jdk-11.0.15\bin\client  

Tomcat comes up, the Web Viewer signon screen comes out but when users try to login they are kicked out.

Environment

Web Viewer 12.1 for Windows Server
Apache Tomcat 9
Java

Cause

Tomcat is inflexible where Java directory structure is concerned.

Resolution

  1. Environment Variables for both JAVA_HOME and JRE_HOME were
    E:\Program Files\Java OPENjdk\jdk-11.0.15\bin\client  and edited them to be
    E:\Program Files\Java OPENjdk\jdk-11.0.15
  1. Edited Service.bat to be

set "PR_JVM= E:\Program Files\Java OPENjdk\jdk-11.0.15\bin\server\jvm.dll"
if exist "%PR_JVM%" goto foundJvm0
set "PR_JVM=E:\Program Files\Java OPENjdk\jdk-11.0.15\bin\client\jvm.dll"
if exist "%PR_JVM%" goto foundJvm0
set "PR_JVM=E:\Program Files\Java OPENjdk\jdk-11.0.15\bin\server\jvm.dll"
if exist "%PR_JVM%" goto foundJvm0
set "PR_JVM=E:\Program Files\Java OPENjdk\jdk-11.0.15\bin\client\jvm.dll"
if exist "%PR_JVM%" goto foundJvm0

Then issued service.bat install tomcat9084 command from a new admin CMD prompt, it was properly installed as a service and users could login.

Additional Information

This problem is not limited to Apache Tomcat 9.0.84