2. Ever-growing and Indivisible Java Runtime
• Java runtime has always been growing in size.
• Java 8 there was no way to install a subset of the JRE.
• All Java installations were distributed with libraries for such
API’s as XML, SQL and Swing (whether you needed them or
not).
• Significant for medium sized computing devices: Routers, TV-
boxes, cars and other tiny nooks and crannies.
• Containers also gains new relevance on servers: Reducing an
image’s footprint will reduce costs.
• Java 8: Compact Profiles
3. Roadmap for JDK 9
26/May/2016 Feature Complete
11/August/2016 All Tests Run
01/September/2016 Rampdown Start
20/October/2016 Zero Bug Bounce
01/December/2016 Rampdown Phase 2
26/January/2017 Final Release Candidate
http://openjdk.java.net/projects/jdk9/
23/Março/2017General Availability
4. Class Country
Class State
Class City
firstfile.jar
Class World
Java Today: No Encapsulation
Country c = new Country();
State s = new State();
City a = new City();
5. Class World
Java Today: Unexpressed Dependencies
?
Problem will rise during runtime: NoClassDefFoundError
Country c = new Country();
6. Class Country
Class State
Class City
firstfile.jar
Class World
Java Today: Shadowing
?
Country c = new Country();
secondfile.jar
Class Country
Class Territory
Class County
7. Class Country
Class State
Class City
firstfile.jar
secondfile.jar
Class Country
Class Territory
Class County
Country c = new Country();
Class World
Java Today: Unexpressed Dependencies
?
9. Class World
Java Today: Startup Performance
Java runtime has
loaded and JIT
compiled all required
classes.
Executes a linear scan
of all JARs on the
classpath
Identifying all
occurrences of a
specific annotation
requires the inspection
of all classes on the
classpath
11. Project Jigsaw
1
Make the Java
SE Platform and
the JDK, more
easily scalable
down to small
computing
devices
2
Improve security
and maintainability
of Java SE Platform
Implementations in
general, and the
JDK in particular
3
Enable improved
application
performance
4
Make it easier for
developers to
construct and
maintain libraries
and large
applications, for
both Java SE and
EE Platforms.
12. [Modules] are named, self-describing program
components consisting of code and data. A
module must be able to contain Java classes and
interfaces, as organized into packages, and also
native code, in the form of dynamically-loaded
libraries. A module’s data must be able to contain
static resources files and user-editable
configuration files.
13. Class Country
Class State
Class City
firstfile.jar
Class World
Java 9: Strong Encapsulation
module com.example {
exports com.example;
}
module-info
Country c = new Country();
City a = new City();
State s = new State();
14. Class Country
Class State
Class City
firstfile.jar
Country c = new Country();
State s = new State();
City a = new City();
Class World
Java 9: Improved Security and Maintainability
module com.example {
exports com.example;
}
module-info
Critical code is now effectively hidden from code that does
not need to use it. It also makes maintenance easier as a
module’s public API can more easily be kept small.