Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

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

January 9, 2019
Syed M Shaaf
Related topics:
JavaDeveloper Tools
Related products:
Streams for Apache Kafka

Share:

    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.

    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:

    • CLI
    • Web console
    • Eclipse plugin
    • Maven plugin

    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.

    If you are running Red Hat Enterprise Linux 7, rpms can be found in the rhel-7-server-rpms channel.

    Run the following command to install OpenJDK:

    $ sudo yum install java-1.8.0-openjdk-devel.x86_64

    Detailed instructions on installing OpenJDK can also be found here.  (See this article if you need to enable sudo)

    Installing Maven

    Now we must also ensure that Maven is installed. First, download it here.

    Once it is downloaded, follow the instructions below, which assume you are running it on Red Hat Enterprise Linux.

    Extract the ZIP archive to the directory where you wish to install Maven.

    Open your .bash_profile file in a terminal: vi ~/.bash_profile.

    Add the M2_HOME environment variable to the file:

    export M2_HOME=/path/to/your/maven (this is where you have extracted maven archive)

    Now let's add the bin directory of Maven to our path so we can use it on our system:

    export PATH=$M2_HOME/bin:$PATH

    Make sure that JAVA_HOME is set to the location of your OpenJDK installation, for example:

    export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk.x86_64

    Make sure that $JAVA_HOME/bin is in your PATH environment variable.

    Save the file and exit your text editor.

    Open a new terminal and run the following command to verify that Maven is installed successfully on your machine:

    $ mvn --version

    If you have, for example, the epel-apache-maven repo, it also possible to install Maven via yum.

    Now that there is a running Java and Maven installation, let's get right to using Red Hat Application Migration Toolkit.

    If you have a current Java project that needs to be analyzed great; otherwise, the following example project can be downloaded here.

    Running Red Hat Application Migration Toolkit

    Let's run through the example project to familiarize ourselves with the setup.

    To use Red Hat Application Migration Toolkit in a project, add the following plugin to the build section of the POM file. In the example project, this already exists.

    <plugin>
    <groupId>org.jboss.windup.plugin</groupId>
    <artifactId>windup-maven-plugin</artifactId>
    <version>4.2.0.Final</version>
    <executions>
      <execution>
        <id>run-windup</id>
        <phase>package</phase>
        <goals>
          <goal>windup</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <offlineMode>true</offlineMode>
      <windupVersion>4.2.0.Final</windupVersion>
    </configuration>
    </plugin>

    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:

    Opening the results 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:

    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.

    Closer look at the incidences

    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:

    Dependencies and how they map

    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.

    Additional Resources

    • Migrating from Oracle JDK to OpenJDK on Red Hat Enterprise Linux: What you need to know
    • What's new in Red Hat Application Migration Toolkit 4.2 including Oracle JDK to OpenJDK migration
    • An introduction to Red Hat Application Migration Toolkit
    Last updated: May 1, 2019

    Recent Posts

    • GuideLLM: Evaluate LLM deployments for real-world inference

    • Unleashing multimodal magic with RamaLama

    • Integrate Red Hat AI Inference Server & LangChain in agentic workflows

    • Streamline multi-cloud operations with Ansible and ServiceNow

    • Automate dynamic application security testing with RapiDAST

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue