8

This Specification introduces the concept of a Java SE Profile, which is a well-defined subset of the Java SE Platform. Profiles allow applications that use just part of the Platform to run on resource-constrained devices. An application that, e.g., does not use the Swing/AWT/2D graphics stack can achieve considerable space savings by running on a Profile that does not include an implementation of those APIs.

This feature is intended to enable the migration of applications currently built on the Java ME Connected Device Configuration (CDC) to appropriate Profiles of the Java SE Platform. It can thus be seen as part of the long-term effort to converge CDC with the Java SE Platform, and is included in this Specification in light of the deferral of a full module system to a future release.

A Java SE Profile is not a Profile Specification as defined in the Java Community Process. This Specification does not define rules by which separate JSR Specifications can define Profile Specifications based upon this Specification.

Constraints A Profile is subject to four constraints:

A Profile must implement the entire Java Virtual Machine Specification that is part of this Specification. The Virtual Machine itself is not subject to subsetting. A Profile must implement the entire Java Language Specification that is part of this Specification. The language itself is not subject to subsetting, and the smallest Profile must contain all of the classes and interfaces mandated by the Java Language Specification. A Profile must be specified as a list of packages. The content of a package in a Profile must be identical to the content of the package of the same name in the complete Java SE Platform, unless explicitly specified otherwise. A Profile may be specified as being larger than some other Profile, in which case the larger Profile must contain all of the packages specified in the smaller Profile.

The complete Java SE Platform is not itself considered a Profile.

Content This Specification defines three Profiles: compact1 , compact2 , and compact3 . compact3 is larger than compact2 , and compact2 is larger than compact1 . The packages added in each Profile are as follows:

compact1 compact2 compact3 java.io java.rmi java.lang.instrument java.lang java.rmi.activation java.lang.management java.lang.annotation java.rmi.dgc java.security.acl java.lang.invoke java.rmi.registry java.util.prefs java.lang.ref java.rmi.server javax.annotation.processing java.lang.reflect java.sql javax.lang.model java.math javax.rmi.ssl javax.lang.model.element java.net javax.sql javax.lang.model.type java.nio javax.transaction javax.lang.model.util java.nio.channels javax.transaction.xa javax.management java.nio.channels.spi javax.xml javax.management.loading java.nio.charset javax.xml.datatype javax.management.modelmbean java.nio.charset.spi javax.xml.namespace javax.management.monitor java.nio.file javax.xml.parsers javax.management.openmbean java.nio.file.attribute javax.xml.stream javax.management.relation java.nio.file.spi javax.xml.stream.events javax.management.remote java.security javax.xml.stream.util javax.management.remote.rmi java.security.cert javax.xml.transform javax.management.timer java.security.interfaces javax.xml.transform.dom javax.naming java.security.spec javax.xml.transform.sax javax.naming.directory java.text javax.xml.transform.stax javax.naming.event java.text.spi javax.xml.transform.stream javax.naming.ldap java.time javax.xml.validation javax.naming.spi java.time.chrono javax.xml.xpath javax.security.auth.kerberos java.time.format org.w3c.dom javax.security.sasl java.time.temporal org.w3c.dom.bootstrap javax.sql.rowset java.time.zone org.w3c.dom.events javax.sql.rowset.serial java.util org.w3c.dom.ls javax.sql.rowset.spi java.util.concurrent org.xml.sax javax.tools java.util.concurrent.atomic org.xml.sax.ext javax.xml.crypto java.util.concurrent.locks org.xml.sax.helpers javax.xml.crypto.dom java.util.function javax.xml.crypto.dsig java.util.jar javax.xml.crypto.dsig.dom java.util.logging javax.xml.crypto.dsig.keyinfo java.util.regex javax.xml.crypto.dsig.spec java.util.spi org.ietf.jgss java.util.stream java.util.zip javax.crypto javax.crypto.interfaces javax.crypto.spec javax.net javax.net.ssl javax.script javax.security.auth javax.security.auth.callback javax.security.auth.login javax.security.auth.spi javax.security.auth.x500 javax.security.cert

The content of each package in these Profiles is identical to the content of the package of the same name in the complete Java SE Platform, except that the problematic APIs proposed for removal in a future release are not present in any of the Profiles, for the same reasons.

The above lists include new packages defined in the Component JSR Specifications. The Profile membership of each class, interface, and package will also be specified in the complete Javadoc API specification.

It is expected that the modular Platform to be defined in a future release will include modules corresponding almost exactly to the Profiles defined here, so that applications that use Profiles can easily be migrated to use modules. It is further expected that these Profiles will be deprecated at that time, so that they can be removed in an even later release.

Rationale The content of each Profile is motivated as follows:

The compact1 Profile contains the smallest set of packages that is feasible without omitting any classes or methods. The logging ( java.util.logging ), SSL/TLS ( javax.net.ssl ), and scripting ( javax.script ) packages are additionally included because it is expected that many applications running on even the smallest Profile will require these facilities. The compact1 Profile is a suitable migration target for applications that currently target CDC 1.1 (JSR 218) and Foundation Profile 1.1 (JSR 219). It includes every package specified in those JSRs, including the “Security Optional Packages” in JSR 219, except for java.security.acl (a legacy API which nobody uses) and the javax.microedition.io and javax.microedition.pki packages (which are Java ME-specific).

The compact2 Profile adds packages for remote method invocation (RMI), database access (JDBC), and XML processing. This Profile is a suitable migration target for applications that currently target CDC 1.1 and Foundation Profile 1.1 and, additionally, one or more of the following Specifications: RMI Optional Package Specification 1.0 (JSR 66) JDBC Optional Package for CDC/Foundation Profile (JSR 169) XML API for Java ME (JSR 280)

The compact3 Profile adds packages for instrumentation, management, naming, scripting, and compilation as well as further packages for database access, security, and cryptography. This Profile is intended for applications that require most of the full Platform except for the desktop user-interface packages (AWT, Swing, etc.), web services (JAX-WS, JAXB, and SAAJ), and CORBA.

Conformance Implementors of this Specification are free to implement zero, one, or more Profiles. They are also free to implement one or more Profiles without implementing the entire Platform. The Technology Compatibility Kit (TCK) for this Specification will be structured so as to allow the conformance of an Implementation of any Profile, or of the entire Platform, to be tested. A Reference Implementation (RI) will be provided for each Profile, and for the entire Platform.

If an Implementation of this Specification implements a Profile then it must be complete, i.e., it must implement every API element of that Profile. If an Implementation implements the entire Platform then it must implement every API element of the Platform. No other forms of Implementation are permitted.