Regarding JEP 110: HTTP/2 Client one might reasonably ask the question: “Why is Java 9 introducing a new HTTP client when there are so many high-quality and time-tested libraries out there?”
There are several answers:
- The first is provided by the the JEP itself: “A number of existing HTTP client APIs and implementations exist, e.g., Jetty and the Apache HttpClient. Both of these are both rather heavy-weight in terms of the numbers of packages and classes, and they don’t take advantage of newer language features such as lambda expressions.”
- Another reason is that with a built-in http client, we can easily use it in the new REPL (thanks Java 9!) without needing to bring in another library.
- Finally, this way the Java platform is free to use a high quality http client for other Java platform features without needing a dependency on an external third-party library.
This question and the thoughtful answer #3 have been brought to you by The Audience from my talk on Java 9 with the Philly Java Users Group. Thanks Philly JUG!