Visual Studio Code Extension Guide


Migration Toolkit for Runtimes 1.2

Identify and resolve migration issues by analyzing your applications with the Migration Toolkit for Runtimes extension for Visual Studio Code.

Red Hat Customer Content Services

Abstract

This guide describes how to use the Migration Toolkit for Runtimes extension for Visual Studio Code to simplify the migration of Java applications.

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.

Chapter 1. Introduction

Migration Toolkit for Runtimes product will be End of Life on September 30th, 2024

All customers using this product should start their transition to Migration Toolkit for Applications.

Migration Toolkit for Applications is fully backwards compatible with all features and rulesets available in Migration Toolkit for Runtimes and will be maintained in the long term.

1.1. About the MTR extension for Microsoft Visual Studio Code

You can migrate and modernize applications by using the Migration Toolkit for Runtimes (MTR) extension for Microsoft Visual Studio Code.

The MTR extension 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 MTR extension is also compatible with Visual Studio Codespaces, the Microsoft cloud-hosted development environment.

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.

Chapter 2. Installing the MTR extension for Visual Studio Code

You can install the MTR extension for Visual Studio Code (VS Code).

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.

Procedure

  1. Set the environmental variable JAVA_HOME:

    $ export JAVA_HOME=jdk11
    Copy to Clipboard
  2. In VS Code, click the Extensions icon on the Activity bar to open the Extensions view.
  3. Enter Migration Toolkit for Runtimes in the Search field.
  4. Select the Migration Toolkit for Runtimes extension and click Install.

    The MTR extension icon ( MTR code extension ) is displayed on the Activity bar.

Chapter 3. Analyzing your projects with the MTR extension

You can analyze your projects with the MTR extension by creating a run configuration and running an analysis.

3.1. MTR extension interface

The interface of the Migration Toolkit for Runtimes (MTR) extension is designed to make it easier for you to find information and perform actions:

  • In the left pane, you can see a directory tree named Analysis Results with a report icon at its top. You can click the icon to open the MTR report in your browser. Beneath the report icon are the other elements of the tree: the applications analyzed by MTR, the rulesets used, and the issues discovered by the analysis.
  • In the upper right pane, you can configure an analysis.
  • In the lower right pane, you can see the settings of the configuration, including source, target, and advanced options. You can view the progress of an analysis in this pane. When the analysis is completed, you can click the Open Report button to open 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.

Figure 3.1. MTR extension interface

MTR extension interface

3.2. Configuring a run configuration

You can configure multiple run configurations to run against each project you import to VS Code.

Prerequisites

  • mta-cli executable installed. You can download the mta-cli executable from mtr download.

Procedure

  1. In Extensions view, click the Migration Toolkit for Runtimes icon ( MTR code extension ) on the Activity bar.
  2. Click the + (plus sign) next to Migration Toolkit for Runtimes to add a run configuration.
  3. Complete the following configuration fields:

    • Name: Enter a meaningful name for the analysis configuration or accept the default.
    • cli: Enter the path to the cli executable. For example: $HOME/mta-cli-1.2.7.GA-redhat-00001/bin/mta-cli.
    • Input: Set to the path of the project that you have open within your IDE by clicking Add and doing one of the following:

      • Enter the input file or directory and press Enter.
      • Click Open File Explorer and select the directory.
    • Target: Select one or more target migration paths.
  4. Right-click the run configuration and select Run.

    When the analysis is completed, you can click the Open Report button to open 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.

Chapter 4. Reviewing and resolving migration issues

You can review and resolve migration issues identified by the MTR extension in the left pane.

4.1. Reviewing issues

You can use the MTR extension icons to prioritize issues based on their severity.

Procedure

  1. Select a run configuration directory on the left pane.
  2. Expand its folders to view the Hints generated for each application file.
  3. Select a hint to view the source code.
  4. Right-click a hint and select View Details to view the Rule ID and other information.
  5. Prioritize issues based on the following icons, which are displayed next to each hint:

    • Mandatory : The issue must be fixed for a successful migration.
    • Warning : The issue might need to be addressed during migration.

4.2. Resolving issues

You can resolve issues by editing the code of a file with a hint

4.2.1. Editing the code of a file

You can edit the file of a project imported to VS Code.

Procedure

  1. In the left pane, right-click an issue and select Open Code.
  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.

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.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat