Compact Profiles

Introduced in OpenJDK 8, compact profiles define subsets of the OpenJDK that reduce the static size of the Java runtime on devices that have limited storage capacity.


A compact profile is a subset of the full OpenJDK. Because they have smaller storage footprints, compact profiles allow 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 and are not related to the Java virtual machine, the language itself, or its tools.

Three compact profiles exist: “compact1”, “compact2”, and “compact3”. Each compact profile includes the APIs of the lower-numbered profiles. For example, “compact2” is a superset of “compact1”. The full OpenJDK is a superset of the “compact3” profile.

The table below shows the high-level composition of each compact profile:

Full OpenJDK 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
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.

JDK 8 tools with explicit support for compact profiles are the following:

  • The javac compiler: The -profile profile option directs the compiler to flag usage of an API not present in profile.
  • The jdeps static dependency analyze: The -profile option shows the profile or file containing a package.


The table below lists the API packages in each of the compact profiles.

compact1 compact2 Additions compact3 Additions java.rmi java.lang.instrument
java.lang java.rmi.activation
java.lang.annotation java.rmi.dgc
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 javax.sql javax.lang.model.type
java.nio javax.transaction javax.lang.model.util
java.nio.channels javax.transaction.xa
java.nio.channels.spi javax.xml
java.nio.charset javax.xml.datatype
java.nio.charset.spi javax.xml.namespace
java.nio.file javax.xml.parsers
java.nio.file.spi javax.xml.transform javax.xml.transform.dom javax.naming javax.xml.transform.sax
java.text javax.xml.transform.stax javax.naming.event
java.text.spi javax.naming.ldap
java.time javax.xml.validation javax.naming.spi
java.time.chrono javax.xml.xpath
java.time.format org.w3c.dom
java.time.temporal org.w3c.dom.bootstrap javax.sql.rowset javax.sql.rowset.serial
java.util javax.sql.rowset.spi
java.util.concurrent org.xml.sax
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


Don’t Forget to Share This Post!

Subscribe to foojay updates:
Copied to the clipboard