Modules
This page covers the implementation of the modularity specifications defined by JSR 277 and JSR 294 as well as the related work in the JDK. It is targeted for inclusion in JDK 7.
Introduction
Superpackages are a new language construct for information hiding that is being defined by JSR 294, and it defines the linguistic unit of modularity in the Java programming language. The Java Module System defined by JSR 277 builds on top of that by defining the deployment unit of modularity; it adds the versioning scheme, distribution format, repository and the comprehensive runtime architecture for the deployment of module-based applications and libraries. In addition to the specifications defined by JSR 277 and JSR 294, other parts of the JDK will be updated to take advantage of the new features, for example the Java launcher program (bin/java
), the java.util.ResourceBundle API, the java.util.ServiceLoader API, etc.
The Modules project hosts the reference implementation of the new core functionality and serves as an umbrella for other related work items developed by other OpenJDK groups.
Status
Early access source code is now available from the OpenJDK download site. Please read the notes below and check out the documentation.
Note that this is a live snapshot of the ongoing development project before it is integrated into the main OpenJDK source tree. At this time, the code may not be as stable or complete as the rest of OpenJDK. It is made available to allow all members of OpenJDK community to collaborate in the development process and to allow for early feedback from interested observers.
The implementation project tracks the specifications developed by JSR 277 and JSR 294. However, it may sometimes be out-of-sync with those specifications. At times it may lag behind them or certain features may not be implemented. At other times the implementation may prototype features to explore their feasibility before they are added to the specifications.
Features
Currently implemented:
- Implementation of the classes in java.module
- Module initialization and class loading
- LocalRepository and URLRepository core functionality
- Launching modules using the
java
command- Prototype
jam
packaging toolNot yet implemented:
- See the daily bug list emails on the modules-dev list
Specifications
JSR 277 early draft (October 2006, new draft expected soon)
JSR 277 expert group observer mailing list.
JSR 277 APIs. The source for the
java.module
package is available under the directorysrc/share/classes
in the implementation sources.JSR 294 superpackage strawman
JSR 294 expert group mailing list and archive.
JSR 294 reflective APIs. The sources for the class
java.lang.reflect.Superpackage
as well as the proposed updates tojava.lang.Class
andjava.lang.ClassLoader
are available under the directorysrc/share/classes
in the implementation sources. Also available are the updates to thejavax.lang.model
APIs that will be made by a maintenance revision of JSR 269.
Source Code
- Source bundle available at the OpenJDK download site.
Documentation
Getting started with the Modules project
Sample modules
Community
- Mailing lists
modules-dev@openjdk: Technical discussion about the implementation of the modules project
modules-discuss@openjdk: General discussion of the modules project and how to use modules
- Bloggers