Installing MongoDB in Java Architecture where multiple versions of the same component exist.

1 minute read time.

Client Java Architecture may have multiple versions of the same components (i.e. JVM, JRE, and JDK)

In this environment we often come across this issue where we are trying to install/upgrade MongoDB, but the installer hangs after validation certificate.

This is due to the fact MongoDb installer supports only JDK / JRE 8x. 

Referencing this KB there is simple workaround to overcome the issue by running the MongoDB installer through these command line syntax.

My current environment

In server we have Zulu JRE version Zulu8.80.0.17 as well as Zulu JRE version Zulu11.74.15 installed.

Current Zulu JRE version Zulu 8.80.0.17 program path is in C:\Program Files\Zulu\zulu-8-jre

Sage MongoDb installer “mongo-db-4.4.26.8.jar” file is in D:\Sage\Support\Mongodb_4.4.26

We create a windows batch file "mongoDBInstall.cmd" with the following command line syntax

REM Start of script to run the installer manually

set JAR_FILE=D:\Sage\Support\Mongodb_4.4.26\mongo-db-4.4.26.8.jar

set JDK8_HOME=C:\Program Files\Zulu\zulu-8-jre\bin

set JAVA_HOME=%JDK8_HOME%

set PATH=%JDK8_HOME%\bin;%PATH%

java -version

java -jar %JAR_FILE%

pause

REM End of script

We run the windows batch file with “Run as Administrator” option – System should launch the MongoDB installer.

We follow installer prompt until we reach the validation certificate window. In this instance when we select “Next” installer should verify prerequisites and let us proceed to next Summery configuration data window.

Now we should be able to complete MongoDB installation as normal.