Migration Toolkit for Runtimes 1.2
IntelliJ IDEA Plugin Guide
Identify and resolve migration issues by analyzing your applications with the Migration
Toolkit for Runtimes plugin for IntelliJ IDEA.
Last Updated: 2024-06-12
Migration Toolkit for Runtimes 1.2 IntelliJ IDEA Plugin Guide
Identify and resolve migration issues by analyzing your applications with the Migration Toolkit for
Runtimes plugin for IntelliJ IDEA.
Legal Notice
Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons
Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is
available at
http://creativecommons.org/licenses/by-sa/3.0/
. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must
provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert,
Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift,
Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States
and other countries.
Linux ® is the registered trademark of Linus Torvalds in the United States and other countries.
Java ® is a registered trademark of Oracle and/or its affiliates.
XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States
and/or other countries.
MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and
other countries.
Node.js ® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the
official Joyent Node.js open source or commercial project.
The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks
or trademarks/service marks of the OpenStack Foundation, in the United States and other
countries and are used with the OpenStack Foundation's permission. We are not affiliated with,
endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Abstract
This guide describes how to use the Migration Toolkit for Runtimes plugin for IntelliJ IDEA to
simplify the migration of Java applications.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Table of Contents
MAKING OPEN SOURCE MORE INCLUSIVE
CHAPTER 1. INTRODUCTION
1.1. ABOUT THE MTR PLUGIN FOR INTELLIJ IDEA
1.2. ABOUT THE MIGRATION TOOLKIT FOR RUNTIMES
What is the Migration Toolkit for Runtimes?
How does the Migration Toolkit for Runtimes simplify migration?
How do I learn more?
CHAPTER 2. INSTALLING THE MTR PLUGIN FOR INTELLIJ IDEA
CHAPTER 3. ANALYZING YOUR PROJECTS WITH THE MTR PLUGIN
3.1. CREATING A RUN CONFIGURATION
CHAPTER 4. REVIEWING AND RESOLVING MIGRATION ISSUES
4.1. REVIEWING ISSUES
4.2. RESOLVING ISSUES
4.2.1. Using a Quick Fix
4.2.2. Editing the code of a file
3
4
4
4
4
4
4
5
6
6
7
7
7
7
8
Table of Contents
1
Migration Toolkit for Runtimes 1.2 IntelliJ IDEA Plugin Guide
2
MAKING OPEN SOURCE MORE INCLUSIVE
Red Hat is committed to replacing problematic language in our code, documentation, and web
properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the
enormity of this endeavor, these changes will be implemented gradually over several upcoming releases.
For more details, see our CTO Chris Wright’s message .
MAKING OPEN SOURCE MORE INCLUSIVE
3
CHAPTER 1. INTRODUCTION
1.1. ABOUT THE MTR PLUGIN FOR INTELLIJ IDEA
You can migrate and modernize applications by using the Migration Toolkit for Runtimes (MTR) plugin
for IntelliJ IDEA.
The MTR plugin analyzes your projects using customizable rulesets, marks issues in the source code,
provides guidance to fix the issues, and offers automatic code replacement, if possible.
The plugin supports both the Community Edition and the Ultimate version of IntelliJ IDEA.
1.2. ABOUT THE MIGRATION TOOLKIT FOR RUNTIMES
What is the Migration Toolkit for Runtimes?
The Migration Toolkit for Runtimes (MTR) is an extensible and customizable rule-based tool that
simplifies the migration and modernization of Java applications.
MTR examines application artifacts, including project source directories and application archives, and
then produces an HTML report highlighting areas needing changes. MTR supports many migration
paths, including the following examples:
Upgrading to the latest release of Red Hat JBoss Enterprise Application Platform
Migrating from Oracle WebLogic or IBM WebSphere Application Server to Red Hat JBoss
Enterprise Application Platform
Containerizing applications and making them cloud-ready
Migrating from Java Spring Boot to Quarkus
Updating from Oracle JDK to OpenJDK
Upgrading from OpenJDK 8 to OpenJDK 11
Upgrading from OpenJDK 11 to OpenJDK 17
Upgrading from OpenJDK 17 to OpenJDK 21
Migrating EAP Java applications to Azure
Migrating Spring Boot Java applications to Azure
For more information about use cases and migration paths, see the MTR for developers web page.
How does the Migration Toolkit for Runtimes simplify migration?
The Migration Toolkit for Runtimes looks for common resources and known trouble spots when
migrating applications. It provides a high-level view of the technologies used by the application.
MTR generates a detailed report evaluating a migration or modernization path. This report can help you
to estimate the effort required for large-scale projects and to reduce the work involved.
How do I learn more?
See the Introduction to the Migration Toolkit for Runtimes to learn more about the features, supported
configurations, system requirements, and available tools in the Migration Toolkit for Runtimes.
Migration Toolkit for Runtimes 1.2 IntelliJ IDEA Plugin Guide
4
CHAPTER 2. INSTALLING THE MTR PLUGIN FOR INTELLIJ
IDEA
You can install the MTR plugin in the Ultimate and the Community Edition releases of IntelliJ IDEA.
Prerequisites
The following are the prerequisites for the Migration Toolkit for Runtimes (MTR) installation:
Java Development Kit (JDK) is installed. MTR supports the following JDKs:
OpenJDK 11
OpenJDK 17
Oracle JDK 11
Oracle JDK 17
Eclipse Temurin™ JDK 11
Eclipse Temurin™ JDK 17
8 GB RAM
macOS installation: the value of maxproc must be 2048 or greater.
The latest version of mtr-cli from the MTR download page
Procedure
1. In IntelliJ IDEA, click the Plugins tab on the Welcome screen.
2. Enter Migration Toolkit for Runtimes in the Search field on the Marketplace tab.
3. Select the Migration Toolkit for Runtimes (MTR) by Red Hat plugin and click Install.
The plugin is listed on the Installed tab.
CHAPTER 2. INSTALLING THE MTR PLUGIN FOR INTELLIJ IDEA
5
CHAPTER 3. ANALYZING YOUR PROJECTS WITH THE MTR
PLUGIN
You can analyze your projects with the MTR plugin by creating a run configuration and running an
analysis.
3.1. CREATING A RUN CONFIGURATION
You can create multiple run configurations to run against each project you import to IntelliJ IDEA.
Procedure
1. In the Projects view, click the project you want to analyze.
2. On the left side of the screen, click the Migration Toolkit for Runtimes tab.
If this is your first configuration, the run configuration panel is displayed on the right.
3. If this is not your first configuration, right-click configuration in the list and select New
configuration.
The run configuration panel is displayed on the right.
4. Complete the following configuration fields:
cli: Enter the path to the cli executable. For example: $HOME/mtr-cli-1.2.6.GA-redhat-
00001/bin/mta-cli.
Input: Click Add and enter the input file or directory.
Target: Select one or more target migration paths.
NOTE
The location shown in the Output is set by the plugin.
5. In the list of configurations, right-click the new configuration and select Run Analysis.
The Console (MTR) terminal emulator opens, displaying information about the progress of the
analysis.
When the analysis is completed, you can click either Report or Results below the name of the
configuration file you ran.
Reports opens the MTR report, which describes any issues you need to address before you
migrate or modernize your application. For more information, see Reviewing the reports in
the CLI Guide.
Results opens a directory displaying hints (issues) per application.
Migration Toolkit for Runtimes 1.2 IntelliJ IDEA Plugin Guide
6
CHAPTER 4. REVIEWING AND RESOLVING MIGRATION
ISSUES
You can review and resolve migration issues identified by the MTR plugin in the left pane.
4.1. REVIEWING ISSUES
You can use the MTR plugin icons to prioritize issues based on their severity. You can see which issues
have a Quick Fix automatic code replacement and which do not.
The results of an analysis are displayed in a directory format, showing the hints and classifications for
each application analyzed.
A hint is a read-only snippet of code that contains a single issue that you should or must address before
you can modernize or migrate an application. Often a Quick Fix is suggested, which you can accept or
ignore.
A classification is a file that has an issue but does not have any suggested Quick Fixes. You can edit a
classification.
Procedure
1. In the Migration Toolkit for Runtimes view, select a run configuration directory in the left pane.
2. Click Results.
The modules and applications of the run configuration are displayed, with hints and
classifications beneath each application.
3. Prioritize issues based on the following icons, which are displayed next to each hint:
: You must fix this issue in order to migrate or modernize the application.
: You might need to fix this issue in order to migrate or modernize the application
4. Optional: To learn more about a hint, right-click it and select Show More Details.
4.2. RESOLVING ISSUES
You can resolve issues by doing one of the following:
Using a Quick Fix to fix a code snippet that has a hint
Editing the code of a file that appears in a classification
4.2.1. Using a Quick Fix
You can use a Quick Fix automatic code replacement to save time and ensure consistency in resolving
repetitive issues. Quick Fixes are available for many issues displayed in the Hints section of the Results
directory.
Procedure
1. In the left pane, click a hint that has an error indicator.
CHAPTER 4. REVIEWING AND RESOLVING MIGRATION ISSUES
7
Any Quick Fixes are displayed as child folders with the Quick Fix icon ( ) on their left side.
2. Right-click a Quick Fix and select Preview Quick Fix.
The current code and the suggested change are displayed in the Preview Quick Fix window.
3. To accept the suggested fix, click Apply Quick Fix.
4. Optional: Right-click the issue and select Mark As Complete.
A green check ( ) is displayed by the hint, replacing the error indicator.
4.2.2. Editing the code of a file
You can directly edit a file displayed in the Classifications section of the Results directory. These files
do not have any Quick Fixes.
Procedure
1. In the left pane, click the file you want to edit.
2. Make any changes needed to the code and save the file.
3. Optional: Right-click the issue and select Mark as Complete or Delete.
If you select Mark as Complete, a green check ( ) is displayed by the hint, replacing the
error indicator.
Migration Toolkit for Runtimes 1.2 IntelliJ IDEA Plugin Guide
8