From the course: Java 8+ Essential Training: Objects and APIs

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Include packages with modules

Include packages with modules - Java Tutorial

From the course: Java 8+ Essential Training: Objects and APIs

Start my 1-month free trial

Include packages with modules

- [Narrator] One of Java 9's most important new features is the concept of API modularity. Known during development as Project Jigsaw, these tools let you break down your app and the core Java API into units known as modules. When you deliver an application you no longer have to deliver the entire core Java class library. Instead you only include what's needed. I'll demonstrate this with a new set of classes for making network requests. These tools were being developed during Java 9's development but at the time Java 9 was released, they were considered still to be in incubator status. So, they are not included in the core Java API files that you get with the SDK. There's a file called rt.jar, that stands for runtime.jar, that includes most of the classes that you typically call in a Java application. The new HTTP packages are not a part of that jar file. And if you want to include them you have to be explicit about it. In this application I have a constant that's pointing to this…

Contents