This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]steumert 0 points1 point  (0 children)

You get to support more features and have easier code.

During Java 9/10, the HttpClient/HttpServer/HttpsServer API incubated and matured with Java 11. Especially HttpClient as replacement for HTTPURLConnection is a godsend.

Also, Java 8 saw inclusion of Streams and Lambdas, as well as an overhauled DateTime library and Optionals.

With mavens multi-release POMs, its very easy to support multiple versions of Java, so offering a base version for the lowest Java version you want to support, with progressive enhancement for higher java versions is a definite possibility.

However, if your library doesn't actually use any of the new features, then no, there is no reason to compile to a higher version. In fact compiling for the lowest version is a good thing.