Blog Articles

Using Red Hat Application Migration Toolkit to see the impact of migrating to OpenJDK

Migrating from one software solution to another is a reality that all good software developers need to plan for. Having a plan helps to drive innovation at a continuous pace, whether you are developing software for in-house use or you are acquiring software from a vendor. In either case, never anticipating or planning for migration endangers the entire innovation value proposition. And in today’s ever-changing world of software, everyone who wants to benefit from the success of the cloud has to ensure that cloud innovation is continuous. Therefore, maintaining a stack that is changing along with technological advancements is a necessity.

In this article, we will take a look at the impact of moving to OpenJDK and the results will aid in drawing further conclusions and in planning. It’s quite common to be using a proprietary version of JDK, and this article addresses how to use Red Hat Application Migration Toolkit to analyze your codebase to understand the impact of migrating to OpenJDK.

What is Red Hat Application Migration Toolkit?

Red Hat Application Migration Toolkit is a customizable and extensible rules-based tool that looks for common resources and highlights technologies and known potential impact areas when migration is required. It can be used with tools like Maven, and it generates reports from its runs that you can view in a browser. It also has browser-based tooling for doing the same.

The goal is to provide a high-level view of the use of technologies like Java and how they can be migrated to the latest versions of OpenJDK or Red Hat JBoss Enterprise Application Platform or even from other containers. The goal is to give a general impact analysis that will aid in estimates, documentation, and migration. For more details on Red Hat Application Migration Toolkit, please visit the see the documentation.

Everything you need to grow your career.

Getting started with Red Hat Application Migration Toolkit

Red Hat Application Migration Toolkit has the following different interfaces. For the sake of simplicity, we will stick to the Maven example. In any case, the following links should help provide further information:

Let’s get started. We will need to set up the prerequisites to run the Red Hat Application Migration Toolkit.

Installing OpenJDK

Red Hat Application Migration Toolkit has been tested on Linux, Windows, and macOS. Other operating systems with Java 8+ support should work equally well and Oracle JDK 8 will also work, assuming you have a running JDK setup.

This will allow Red Hat Application Migration Toolkit to run during the builds.

Via the terminal, navigate to the project directory and use the following command to execute the build on the terminal.

$ mvn clean install

Viewing the analysis report

The build could take some time depending on the source. It will ensure that Red Hat Application Migration Toolkit is downloaded and will execute the analysis ending with a nice report. Once the build is finished, the results can be accessed via the following directory in the project:

target/windup-report/index.html

Let’s go through the results by opening the page in a browser:

In the browser, you can see areas of potential migration and also the application name. Click on “main,” which should navigate to the details page:

When migrating from Oracle JDK to OpenJDK there will be differences based on the version of JDK. In the report shown above, the incidents, that is, APIs that will not work with OpenJDK, are reported. In the above example, javafx from our application is reported, as are crypto and awt.

Let’s take a more detailed look at what these incidents are by clicking the Issues tab.

The screenshot above shows clear explanations of incompatibilities when migrating from Oracle JDK to OpenJDK version 8. There are also details with links to the knowledge base as well as a description of what remedies can be made. These hints should give guidance and also help in estimating the efforts required to change the code on a class or per-line basis.

Taking it a bit further, as a project leader, you would also want to know the dependencies and how they map. Red Hat Application Migration Toolkit does that in detail for all the code it has analyzed. Following is another screenshot that illustrates this:

Conclusion

The example above showcases some of the affected areas during a migration and the usefulness of Red Hat Application Migration Toolkit for such project.

There are many more interesting features. To read further, visit the documentation page here.

If you would like to try the above example, it’s also shared in the GitHub repo with the sample code and Maven POM file.