Skip to content

Document Java migration tool#11385

Merged
quinntracy merged 5 commits into
mendix:developmentfrom
emirmx:run/5152-document-java-migration-tool
Jul 6, 2026
Merged

Document Java migration tool#11385
quinntracy merged 5 commits into
mendix:developmentfrom
emirmx:run/5152-document-java-migration-tool

Conversation

@emirmx

@emirmx emirmx commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@emirmx

emirmx commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Waiting for runtime team review...

@akkrishnakumar

Copy link
Copy Markdown
Contributor

Waiting for runtime team review...

Approved by Runtime Team

@quinntracy quinntracy self-assigned this Jun 19, 2026
@quinntracy

Copy link
Copy Markdown
Collaborator

@emirmx Is this for 11.12?

@emirmx

emirmx commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@emirmx Is this for 11.12?

It is a separate tool so not tied to 11.12 technically.

@quinntracy

Copy link
Copy Markdown
Collaborator

@emirmx How long has it been available (as of which release)? If it is not tied to a specific release, can it be merged after review?

@emirmx

emirmx commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@emirmx How long has it been available (as of which release)? If it is not tied to a specific release, can it be merged after review?

The tool is not released yet. Should we ping you when the tool is released?

@quinntracy

Copy link
Copy Markdown
Collaborator

@emirmx Yes, if it's not going out with 11.12 but is not yet live, then you can either leave a comment here or message me on Slack so I can merge the updates when it is available. Thank you!

@emirmx

emirmx commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@emirmx Yes, if it's not going out with 11.12 but is not yet live, then you can either leave a comment here or message me on Slack so I can merge the updates when it is available. Thank you!

Thanks!

@emirmx emirmx force-pushed the run/5152-document-java-migration-tool branch from 52fb1a2 to f54ff9a Compare June 22, 2026 08:59
@emirmx emirmx force-pushed the run/5152-document-java-migration-tool branch from f54ff9a to 604f3d8 Compare June 22, 2026 09:01
@emirmx

emirmx commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

We released the CLI tool to CDN, so this PR can be merged.
@quinntracy

@MarkvanMents MarkvanMents self-requested a review July 3, 2026 12:49

@MarkvanMents MarkvanMents left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @emirmx and @akkrishnakumar
I've proofread this here d85842a and have three questions/comments.
Please can you look at these and get back to me.
I'm OOO on Monday 6th but will be back on Tuesday 7th.
Please contact @quinntracy if this needs to be progressed on Monday.

|---------|-------------|
| `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) |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be clearer. Does it take files which are in /javasource and copy them to the rewrite PATHS or does it now only take files which are in rewrite <PATHS> and ignore all the others?

@akkrishnakumar akkrishnakumar Jul 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rewrite is the command. <PATHS> is ,for example, /javasource folder. But it can really be any folder that contains .java files. But we don't want to mention that in the documentation.

only take files which are in rewrite and ignore all the others?

None of the files are copied to a different/temporary location. Hence, this is true


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:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And subfolders, or just the javasource folder

@akkrishnakumar akkrishnakumar Jul 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the .java files in javasource, including sub folders.

{{% alert color="warning" %}}
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "as much as possible" mean here? Do you mean "only have errors related to deprecated and missing APIs?"

@akkrishnakumar akkrishnakumar Jul 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We presume that the project was compiled/run in a prior version of Studio Pro and that the code is working. Then you do a model upgrade by downloading, let say, Mx 11.12.

In the new version, some APIs may have been refactored, some APIs may have been removed. If you try to compile the project with a removed API, the app will not start. But this is not a problem for the rewrite tool and it can still perform the rewrite

The tool may face some issues during rewrite if the project was not compiled and run correctly in a pervious version. There could be a chance that a recipe is applicable, but the rewrite will not be performed due to type check failures.

Hence, we mention "As much as possible". Because having a missing API is technically a compilation issue for Studio Pro. But not for the Java migration tool.
I hope that I made myself clear. There isn't a better way to put this without a demo.

@quinntracy quinntracy merged commit 7ccfc6b into mendix:development Jul 6, 2026
3 checks passed
@quinntracy

Copy link
Copy Markdown
Collaborator

@MarkvanMents The team requested this PR was merged ASAP. Due to reviews being completed and no obvious changes being requested, I merged it. However, feel free to take a look when you are back tomorrow and clarify with @akkrishnakumar as necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants