Compact profiles, introduced in Java SE 8, define subsets of the Java SE Platform API that can reduce the static size of the Java runtime on devices that have limited storage capacity.
A compact profile (or simply profile) is a subset of the full Java SE Platform API. Because they have smaller storage footprints, profiles can enable many Java applications to run on resource-constrained devices. Choosing a profile that closely matches an application's functional needs minimizes the storage devoted to unused functions.
Compact profiles address API choices only; they are unrelated to the Java virtual machine, the language proper, or tools.
There are three profiles, compact1, compact2, and compact3. Each profile includes the APIs of the lower-numbered profiles (compact2 is a superset of compact1). The full SE API is a superset of the compact3 profile. The following table shows the high-level composition of each:
Full SE API | Beans | JNI | JAX-WS |
Preferences | Accessibility | IDL | |
RMI-IIOP | CORBA | Print Service | |
Sound | Swing | Java 2D | |
AWT | Drag and Drop | Input Methods | |
Image I/O | |||
compact3 | Security1 | JMX | |
XML JAXP2 | Management | Instrumentation | |
compact2 | JDBC | RMI | XML JAXP |
compact1 | Core (java.lang.* ) |
Security | Serialization |
Networking | Ref Objects | Regular Expressions | |
Date and Time | Input/Output | Collections | |
Logging | Concurrency | Reflection | |
JAR | ZIP | Versioning | |
Internationalization | JNDI | Override Mechanism | |
Extension Mechanism | Scripting |
1. Adds kerberos, acl, and sasl to compact1 Security.
2. Adds crypto to compact2 XML JAXP.
These JDK 8 tools have explicit support for profiles:
-profile
profile option directs the compiler to flag usage of an API not present in profile. jdeps
static dependency analyzer [Solaris, Linux, or Mac OS X or Windows]: The -profile
option shows the profile or file containing a package. The following table lists the API packages in each of the compact profiles. The API Reference also defines profile composition.
compact1 | compact2 Additions | compact3 Additions |
---|---|---|
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 |