Java 9 modules
- Classpath
- November 6, 2015
- What Do WebLogic, WebSphere, JBoss, Jenkins, OpenNMS, and Your Application Have in Common? This Vulnerability.
- By @breenmachine
rt.jar : 65 MB
- Java 9 Module System
- Reliability
- Security
- Size
Modular JDK
Modular JDK
Modular JDK
Modular JDK
Deprecated JDK modules
Non-standard JDK modules
- Internal modules
Deprecated JDK modules
- … back to Java EE
Non-standard JDK modules
- Deleted classes
- Hidden packages
Module descriptor
Build module
Run module
Modular application
Modular application
Module descriptor
Export package
Multi-modules layout
Multi-modules layout
- 1 project = n modules
Create module
The Jigsaw Sandwich
The Jigsaw Sandwich
Encapsulation
Visibility
Visibility
Visibility
Split package
Regular export
Restricted export
sun.misc.Unsafe
New internal unsafe API (hidden) |
Keep sun.misc in 9, remove features when public replacement APIs exist |
Deep reflection
Deep reflection
- Open a package
- Open all the packages of the module
Module dependency
Transitive dependency
Transitive dependency
Static dependency
- Compile time only
Plain old jar
Plain old jar
Plain old jar
- No dependency to classpath
Plain old jar
Automatic Module
Automatic Module
- Plain old jar in module-path
Mixed mode
Mixed mode
Running on Java 9
- Compiling in Java 8
Big kill switch
- --permit-illegal-access
This option will only be supported in JDK 9. It will be removed in JDK 10. |
Command line java / javac
- Add root module
- --add-modules
Command line java / javac
jdeps
- Diagnostic tool
- since Java 8
- jdeps --jdk-internals
Going Native
jlink
- Custom runtime image
- Specific for a platform
- For small devices or in the cloud
jlink
Ahead Of Time compilation
- Module ⇒ shared library
- .so, .dll, .dynlib
experimental feature ! |
Ahead Of Time compilation
- Run in AOT mode
experimental feature ! |
Benchmarks
Benchmarks
Conclusion
Jigsaw Goals
- Reliable configuration
- No classpath anymore
- compile time / runtime fidelity
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Jigsaw Goals
- Scale down the platform
- downsized unit of re-use
Jigsaw Goals
- Strong encapsulation
- Separate public types from implementation
- Enhanced security
Jigsaw Goals
- Closed World
- Ahead of time optimizations
Jigsaw Goals
- Reliable configuration
- Scale down the platform
- Strong encapsulation
Planning
Planning
- Public Review Ballot (2017-05-08)
?
Références
- Download JDK 9 Early Access
- Oracle JDK 9 Documentation
Références
- JavaOne, DevoxxBE talks