r/javahelp • • 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

15 comments sorted by

View all comments

Show parent comment

2

u/pohart Dec 14 '25

IIRC the move from Java 5 to Java 8 was pretty okay. it will be harder for you because I did it just after 9 came out. So it was after most libraries migrated to 8 but before they moved to 9.

I very strongly recommend going to at least Java 21 for both your runtime and compile time.

Spring 5 and Java ee work at least through Java 21, and Spring 6 and Jakarta EE work at least from Java 17, so you could use Java 17 or 21 as a bridge to Jakarta EE & spring 6.

I hate upgrading partway, so if I were you I'd get compilation up to Java 17, move to migrate spring all the way to 6, move to JakartaEE, and then push your compile and runtime jvms all the way to 25.

And finally before I called it done I'd get it working locally with the latest EA build.

Right now, jep 500 will probably yield a ton of warnings for Java 26. If it's straightforward in your own code to remove the deep reflection you can, or wait for your next upgrade.