Migrating from Oracle JDK to OpenJDK on Windows | JSCAPE
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.
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.
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.
Another place to check is the inst_jre.cfg
file found inside the .install4j
subfolder of your JSCAPE MFT Server installation.
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.
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.
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.
π‘ Want to test drive JSCAPE MFT Server on a trial basis? Request a FREE trial.
You'll be asked to register for Red Hat account. It's free, so that shouldn't be a problem.
Once you've registered, you'll then be allowed to download your desired installer.
As soon as the download completes, just run the installer and follow the instructions in the 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.
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-1.8.0.232-3\jre\
So, we delete the old path and enter this path into the inst_jre.cfg
file likeso:
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,
... check whether the service has already stopped (e.g. by attempting to load the 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.
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.
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.
That's it. Now you know how to migrate from Oracle Java to OpenJDK on a Windows host.
Test your knowledge with a free trial.