Java Migration Tool
Introduction
The Java Migration Tool (jmt) is a command-line utility that automatically rewrites deprecated and removed Mendix Java API calls.
The tool complements the Update Assistant (Beta) pane: use the pane to identify deprecations, and the CLI to apply the fixes automatically.
Installation
Download the tool from Mendix CDN: https://cdn.mendix.com/mendix-java-migration-tool/jmt-1.0.0.jar
Basic Usage
Run the tool from a command prompt. Use the same Java version that the version of Studio Pro you are migrating to uses. You can find the Java installation path in Studio Pro's preferences.
The following example rewrites all Java files in the javasource/ folder of your app to the target Studio Pro version:
This example assumes:
- The Java executable is saved to
C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot\bin\java jmt-1.0.0.jaris saved to the current folder- Mendix 11.11.0 is installed at
C:\Program Files\Mendix\11.11.0 - Your app folder is
C:\Users\YourName\Mendix\MyApp
"C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot\bin\java" -jar jmt-1.0.0.jar rewrite --to-version 11.11 --studio-pro "C:\Program Files\Mendix\11.11.0" --project-root "C:\Users\YourName\Mendix\MyApp"Replace the paths and version number with the actual values for your installation. For all available commands and options, see Commands and Options.
Commands
Run the tool with java -jar jmt-1.0.0.jar <COMMAND> [OPTIONS].
- If Java is on your
PATH, calljavadirectly. If not, provide the full path to thejavaexecutable. - Run the command from the folder where you saved
jmt-1.0.0.jar, or specify its full path in the command.
| Command | Description |
|---|---|
version |
Display the tool version |
recipes |
List all available migration recipes |
rewrite <PATHS> |
Rewrite Java files that are in the given paths (files or folders) |
Options
Global
-h, --help– show usage information
recipes Command
-o, --output <FORMAT>– output format:text(default) orjson
rewrite Command
-t, --to-version <VERSION>– (required) target Studio Pro version, for example11.2.0-n, --dry-run– preview changes without writing files-o, --output <FORMAT>– output format:text(default) orjson-p, --project-root <PATH>– root of the Mendix project. This enables classpath resolution viajavasource/,vendorlib/, anduserlib/-s, --studio-pro <PATH>– Studio Pro installation folder. This enables Mendix public Java API resolution via the runtime bundles
Using -p and -s is strongly recommended. The tool relies on type binding resolution to apply recipes correctly. For example, it only rewrites getMember calls when it can confirm the receiver is an IMendixObject. Without these options, type information may be incomplete and recipes may not be applied.
For the same reason, the Java code in your project must be error-free as much as possible before running the tool. Missing imports, unresolved types, or variables declared without a fully qualified type name can prevent a recipe from recognizing a valid call site.
Examples
Commands
# List available recipes
java -jar jmt-1.0.0.jar recipes
# Apply with full project context for accurate type resolution
java -jar jmt-1.0.0.jar rewrite javasource/ -t 11.2.0 \
-p /path/to/mendix-project \
-s "/path/to/Studio Pro 11.2.0"
# Preview changes without writing (dry run)
java -jar jmt-1.0.0.jar rewrite javasource/ -t 11.2.0 -n
# Apply all applicable recipes to the javasource folder
java -jar jmt-1.0.0.jar rewrite javasource/ -t 11.2.0
# Machine-readable output for CI/CD integration
java -jar jmt-1.0.0.jar rewrite javasource/ -t 11.2.0 -o jsonOutput Formats
Text (default) – human-readable summary:
[REWRITE] Target version: 11.2.0
Applied recipes:
- Replace IMendixObject.getMember(...) (available from: 10.18)
Changed: javasource/myfirstmodule/actions/MyAction.java
Replace IMendixObject.getMember(...): 2
Files processed: 1
Files changed: 1
Total changes: 2JSON – machine-readable, suitable for CI/CD pipelines:
{
"status": "success",
"dryRun": false,
"filesProcessed": 1,
"filesChanged": 1,
"totalChanges": 2,
"files": [
{
"file": "javasource/myfirstmodule/actions/MyAction.java",
"changes": [
{
"recipe": "Replace IMendixObject.getMember(IContext, String) with IMendixObject.getMember(String)",
"count": 2
}
]
}
],
"warnings": []
}