THE INFORMATION IN THIS ARTICLE APPLIES TO:
QUESTION
How do I update the Java JRE that was installed with DMZ Gateway?
ANSWER
Procedures are provided for both Windows and Linux below.
WINDOWS
Since Oracle announced that public (free) JRE updates are no longer available for commercial or production environments as of January 2019. DMZ Gateway v3.5.0.23 installs with the last "free" version, v1.8.0_202. We have made updates to DMZ Gateway, but have not updated the JRE past 1.8.0_202.
If you want to update the JRE used in DMZ Gateway, you can purchase a license from Oracle or download another Java product such as OpenJDK. The procedure for Oracle's JRE replacement is described below. Be sure to read instructions on the website from which you download a new JRE in case there are updating/replacing differences that you need to be aware of.
Globalscape will still support DMZ Gateway, but is unable to extend support to a version of the JRE not included with the product, should a defect or incompatibility related issue be traced back to the JRE as the root cause. Contact the provider of that version of the JRE for support.
Updating the Oracle JRE on Windows
Disclaimer: You are responsible for the Oracle JRE licensing obligations. Following is the procedure for updating the Oracle JRE for DMZ Gateway if you want to continue with Oracle JRE. A sample batch file called “JRE_replacer.bat” is included below and can be used to execute steps 4 through 6.
Windows x86 32-bit and 64 bit
- Make a backup of your current “..\GlobalSCAPE\DMZ Gateway” folder.
- Download the archive for the desired version of JRE for your OS from Oracle at https://www.Oracle.com/java/technologies/javase-downloads.html. Please note that the location of these archives may have changed since this document was last updated.
Be sure you are downloading the appropriate archive for your operating system (32-bit or 64-bit).
- Unzip the archive and extract the folder JRE1.x.x.xxx to “..\GlobalSCAPE\DMZ Gateway\bin\” (usually present under “C:\Program Files\” )
All example paths below are relative to the DMZ installation folder. If a different folder is desired for the new JRE, replacement paths given below can instead be absolute paths to the new JRE install folder.
- Create a copy of JRE1.x.x.xxx/bin/java.exe and name it DMZGatewayAdmin.exe
- Create a copy of JRE1.x.x.xxx/bin/java.exe and name it DMZGatewayServer.exe
- Change the references from the old JRE to the new JRE in DMZGatewayAdminLauncher.cfg and DMZGatewayServerService.cfg, configuration files. These files are in the “..\GlobalSCAPE\DMZ Gateway\conf” folder. There may be multiple references in each configuration file that need to be changed.
For example, if updating the JRE from 1.8.0_162 to 1.8.0_291, for DMZ 3.5.0, the lines in DMZGatewayAdminLauncher.cfg may look like:
java.command=bin/jre1.8.0_162/bin/DMZGatewayAdmin
java.additional.4=Djava.ext.dirs=bin/jre1.8.0_162/lib/ext
This should be changed to something like:
java.command=bin/jre1.8.0_291/bin/ DMZGatewayAdmin
java.additional.4=Djava.ext.dirs=bin/jre1.8.0_291/lib/ext
- Delete the old JRE folder from “..\GlobalSCAPE\DMZ Gateway\bin\”
-
Start the DMZ server and make sure the log files DMZGatewayServerService.log and DMZGatewayAdminLauncher.log under “..\GlobalSCAPE\DMZ Gateway\logs” refer to the new JRE.
If you wish to automate some of this process, a sample batch file called “JRE_replacer.bat” is included below and can be used to execute steps 4 through 6.
Place “JRE_replacer.bat” under “..\GlobalSCAPE\DMZ Gateway\”, make the appropriate substitutions for the versions of the JRE you are working with, open the command prompt or PowerShell as an administrator, and run the script. If everything runs fine you will see a “Thank you” message.
JRE_replacer.bat file
REM Replace "jre1.8.0_202" with the version you are updating from
SET _oldJRE=jre1.8.0_202
REM Replace "jre1.8.0_251" with the version you are updating to
SET _newJRE=jre1.8.0_251
REM The following replicates steps 4 and 5 from “Updating_DMZ_JRE.doc”
copy bin%_newJRE%\bin\java.exe bin%_newJRE%\bin\DMZGatewayAdmin.exe
copy bin%_newJRE%\bin\java.exe bin%_newJRE%\bin\DMZGatewayServer.exe
@echo off
REM The following replicates step 6 from “Updating_DMZ_JRE.doc”
set "replace=%_oldJRE%"
set "replaced=%_newJRE%"
set "source=conf\DMZGatewayAdminLauncher.conf"
set "target=conf\DMZGatewayAdminLauncher_temp.conf"
setlocal enableDelayedExpansion
(
for /F "tokens=1* delims=:" %%a in ('findstr /N "^" %source%') do (
set "line=%%b"
if defined line set "line=!line:%replace%=%replaced%!"
echo(!line!
)
) > %target%
endlocal
xcopy /y %target% %source%
del %target%
set "source=conf\DMZGatewayServerService.conf"
set "target=conf\DMZGatewayServerService_temp.conf"
setlocal enableDelayedExpansion
(
for /F "tokens=1* delims=:" %%a in ('findstr /N "^" %source%') do (
set "line=%%b"
if defined line set "line=!line:%replace%=%replaced%!"
echo(!line!
)
) > %target%
endlocal
xcopy /y %target% %source%
del %target%
echo Thank you, you have successfully upgraded the JRE for DMZ, please make sure to delete old JRE folder from "..\GlobalSCAPE\DMZ Gateway\bin"**
Updating the ORACLE JRE FOR DMZ on Linux machine
Disclaimer: Users are responsible for the Oracle JRE licensing obligations. Following is the procedure for updating the Oracle JRE for DMZ if they wish to continue with Oracle JRE.
Note: The major version we support is 8.x, any later versions (9.x and above) are untested by us and may or may not work.
Linux x86 32-bit and 64 bit – tested on Ubuntu Server 20.04.2 LTS
- Make a backup of your current “/opt/dmzgateway” folder if you have selected that as the installation folder. If not, backup the installation folder wherever you have it installed.
- Download the archive for the desired version of JRE for your operating system from Oracle at https://www.oracle.com/java/technologies/javase-jre8-downloads.html. (Please note that the location of these archives may have changed since this document was last updated.)
- Unzip the archive and extract the folder JRE1.x.x.xxx to “/opt/dmzgateway/bin/”
- Change the references from the old JRE to the new JRE in DMZGatewayAdminLauncher.cfg and in DMZGatewayServerService.cfg, configuration files. These files are in “/opt/dmzgateway/conf” folder. There may be multiple references in each configuration file that need to be changed.
For example, if updating the JRE from 1.8.0_162 to 1.8.0_291, for DMZ 3.5.0 the lines in DMZGatewayAdminLauncher.cfg may look like:
java.command=bin/jre1.8.0_162/bin/java
java.additional.4=Djava.ext.dirs=bin/jre1.8.0_162/lib/ext
This should be changed to something like:
java.command=bin/jre1.8.0_291/bin/java
java.additional.4=Djava.ext.dirs=bin/jre1.8.0_291/lib/ext
- Start the DMZ server and make sure the log files DMZGatewayServerService.log and DMZGatewayAdminLauncher.log under “/opt/dmzgateway/logs” refer to the new JRE
- If everything works as expected delete the old JRE folder from “/opt/dmzgateway/bin/” (or wherever it exists).