What is the best way to migrate Java code of an older jdk (1.5) to a more recent Java version (1.8) to provide from its new features and improvements. We have a large Java jdk 5 code base and want to migrate to jdk 8.
There are a lot of compiler warnings and hints (e.g. diamond operator
, multicatch
, unnecessary (un)boxing
, etc) which will improve the performance, code readability, etc.
We are using Netbeans IDE. Are there any plugins which we can use or are there migration scripts?
Found what I was looking for: Netbeans offers Inspect and Transform
.
This can be used to transform your complete code base (or parts of it) with a configuration of changes.
This is how it works:
Refactor
menuInspect and Transform
menu itemconfiguration
and configure it using the Manage
buttonCan Use Diamond
, Join catch sections using multicatch
, unnecessary boxing
, etc.)Inspect
Do Refactoring
Your complete code base is refactored and uses your selected new features and new idioms.
IntelliJ IDEA has a similar feature. See Analyze
> Inspect Code ...
In Eclipse this is called clean up
in code style
(configuration) or source
(menu).