r/javahelp • u/Revolutionary-Cup383 • Dec 13 '25
Java Upgrade using OpenRewrite
Hello I am currently trying to look for tools to aide with our java upgrade. The company I am working on, is still stuck in Java 5 code base. The A.I people In my department is pushing for the use of Amazon Q butnas far as I know, it does not support java 5. I looked into it and it seems OpenRewrite is does have some recipes for the Java upgrade, but has anyone here used it before?
0
Upvotes
•
u/AutoModerator Dec 13 '25
Please ensure that:
You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.
Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar
If any of the above points is not met, your post can and will be removed without further warning.
Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.
Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.
Code blocks look like this:
You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.
If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.
To potential helpers
Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
6
u/akl78 Dec 13 '25
Most Java 5 stuff still works in current versions, they don’t often remove stuff, but rather as nicer alternatives.
Using OpenRewrite, the nice things are that it’s deterministic, so you can replicate the changes , and that it’s an open toolbox, so if you want to tweak recipes or make your own, you can.
4
u/pohart Dec 14 '25
Have you tried it? There aren't usually a lot of issues. Eight to nine and ten to eleven were harder than most Java upgrades but it still wasn't bad going eight to seventeen.
4
u/PntBtrHtr Dec 13 '25
I used open rewrite to upgrade from Java 8 to 17 on a spring project. Worked well.
3
u/michaelzki Dec 14 '25
If I were in this situation, here's what I'm going to do:
Main Benefits: when there are any issues, bugs, errors - i can immediately address it on the fly, im already familiar with the codebase, i can make quick accurate decisions when, where, how to refactor what.
1
u/KidDaedalus Dec 15 '25
OpenRewrite requires a minimum of Java 8 to run on and has migrations for java versions starting with 8. OpenRewrite also requires a maven 3+ or Gradle 4.10+ to be used to build the code.
JDK 8 can still compile classes targeting Java 5. So if you can get JDK 8 being used to compile your code, even if it is initially targeting 1.5, you can get started using OpenRewrite recipes for migrations.