We have been following the official Java migration guide to upgrade our application from Java 6 to Java 8. Unfortunately we haven't set source and target version to 1.8 to prevent the usage of new language features.
So currently we are compiling and executing our application with JDK 1.8 / JRE 1.8
but set source and target level to 1.6
.
Nevertheless, we now even want to level up the source and target level for our applications to 1.8.
Does setting those properties only changes the allowed features for the compilation and the binary format of the classes or does the configuration changes the semantics of the application? We expect that there shouldn't be any known issues or incompatibility when updating the source and target version to a higher version, when staying on the same JRE for execution and JDK for compilation.
Does setting those properties only changes the allowed features for the compilation and the binary format of the classes or does the configuration changes the semantics of the application?
It can actually change the semantics of the Java language. For example, the meaning of @Overrides
changed between Java 5 and Java 6. (I can't recall any changes like that between Java 6 and Java 8, but ....)
And of course:
In short, even though upgrading from one version to the next ... or just changing the --source
or --target
is usually innocuous, it can sometimes lead to problems that need to be fixed.
So ... test everything ... thoroughly. Don't assume that it will all just work when you roll our the newer version.
Of course, it is advisable to read the lists of bug fixes and incompatibilities in the respective release notes. But be aware that the lists may be incomplete, or that you won't realize that some fix impacts your code. (Who knows / remembers every implementation detail of an large application written many years go?) And be aware that the fixed bug lists in a new major release are incremental from a previous patch release.
The counterpoint is that, you can't just defer upgrading because. The longer you put it off, the harder it becomes and the larger your codebase's technical debt becomes. And you may find yourself having to do the upgrade in a panic; e.g. due to an unpatched security problem, an OS support issue, and so on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With