Migrating from Oracle JDK to OpenJDK on Windows | JSCAPE

Check out our guide for migrating from Oracle to OpenJDK to continue using JSCAPE MFT Server. This guide can help you avoid the costs of paid subscriptions.

  1. Blog

JSCAPE MFT Server customers who want to avoid the Oracle Java paid subscriptions can simply migrate to any of the free open Java (OpenJDK) distributions. JSCAPE MFT Server readily supports OpenJDK, so you won't lose any of its capabilities when you do an Oracle Java to OpenJDK migration. In this post, we'll show you just how easy it is to do that on a Windows host.

Watch the video

Would you prefer to watch a video version of this tutorial instead? You can play the video below. Otherwise, just skip it if you wish to continue reading.

Before you do any migration, you might want to check first if you're actually using Oracle Java to run your JSCAPE MFT Server instance. The easiest way to do that is by launching the command prompt and then running this command:

java -version

If you see something like Java (TM) .... , then that means you're using Oracle Java.

java -version

Now, in some instances, it's possible that you're actually running multiple versions of Java and the one you see when you run 'java -version' is just the version Windows is configured to use by default. That might not be the version your JSCAPE MFT Server instance is running on.

To know for certain which one it is, navigate to your JSCAPE MFT Server installation directory, go to the /var/log subdirectory, and open the server0.log file.

var log server0 log

Once you open that file, look for the entry that displays the JRE being used. In most cases, especially if you only have one version of Java running on your Windows host, the JRE version displayed there will match what you see when you run the 'java -version' command in the command prompt.

jre in server0 log

Another place to check is the inst_jre.cfg file found inside the .install4j subfolder of your JSCAPE MFT Server installation.

inst_jre cfg

Once you open that file in a text editor, you should see the path to the exact Java runtime environment used by JSCAPE MFT Server. Whenever JSCAPE MFT Server starts up, it will check this file to see which Java installation it's supposed to run on.

path to jre used by jscape mft server

Again, if you only have one version of Java running on your machine, the version of that JRE should match what you saw earlier.

Now that you're sure you're using Oracle Java, you can now proceed to download and install your desired OpenJDK distro. In this example, we'll be using the one from Red Hat. So, as you can see from their site, this is Red Hat's implementation of OpenJDK, which as you know by now is a free and open source implementation of the Java Platform.

red hat openjdk download page

In the download page, you'll see several installers in MSI or ZIP format. Personally, I prefer an MSI rather than a ZIP installer because I like the program to be added to the Program File folder and the Programs module for quick access but you can pick whichever installer you like.

I'm running my JSCAPE MFT Server instance on a 64-bit Windows Server, so I'll just download the MSI for that.

red hat openjdk download installers

You'll be asked to register for Red Hat account. It's free, so that shouldn't be a problem.

red hat register

Once you've registered, you'll then be allowed to download your desired installer.

download red hat openjdk msi installer

As soon as the download completes, just run the installer and follow the instructions in the installation wizard.

redhat openjdk installation wizard

Note that if you specify an installation directory and not use the default directory, you need to take note of your chosen directory, as you'll be needing it in a short while.

red hat openjdk installation directory

After installation, you'll effectively have two JREs running on your Windows host. One Oracle Java and one Red Hat OpenJDK. Because your JSCAPE MFT Server instance is still running on Oracle Java, you'll need to tell it to use OpenJDK moving forward.

Remember that inst_jre.cfg file found inside the .install4j subfolder of your JSCAPE MFT Server installation directory? That's where you're supposed to enter the path to your newly installed Red Hat OpenJDK JRE so that JSCAPE MFT Server will know it's supposed to use that.

But where exactly is that JRE ? If you didn't specify a location during installation, the default path should be in C:\Program Files\RedHat\[openJDK version]\JRE. You need to double-check that. Once you've obtained the right path, replace the original path in the inst_jre.cfg file with that new path.

So, in our example, the original path is (as shown earlier):

c:\program files\java\jre1.8.0_151

and the new path is:

C:\Program Files\RedHat\java-1.8.0-openjdk-\jre\

So, we delete the old path and enter this path into the inst_jre.cfg file likeso:

inst_jre with redhat openjre path

After saving the changes in the configuration file, you need to restart JSCAPE MFT Server in order for it to use those new settings. Just to be absolutely sure, I usually run the stop_service batch file,

stop_service windows batch file

... check whether the service has already stopped (e.g. by attempting to load the JSCAPE MFT Server administrative web service)

unable to load jscape mft server administrative web service

... and then, after confirming that the service has stopped, start it back up again by running the start_service batch file.

start_service windows batch file-1

After a couple of seconds, you can verify whether JSCAPE MFT Server is actually using the newly installed JRE by opening the server0.log file again and checking the JRE version if it matches that of the newly installed JRE.

jre version in server0 log

If you're sure no program is using your Oracle Java installation anymore, we recommend you uninstall it to avoid any confusion in the future.

uninstall jre-1

That's it. Now you know how to migrate from Oracle Java to OpenJDK on a Windows host.