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.

Introduction

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 BeansJNIJAX-WS
PreferencesAccessibilityIDL
RMI-IIOPCORBAPrint Service
SoundSwingJava 2D
AWTDrag and DropInput Methods
Image I/O
compact3Security1JMX
XML JAXP2ManagementInstrumentation
compact2JDBCRMIXML JAXP
compact1Core (java.lang.*)SecuritySerialization
NetworkingRef ObjectsRegular Expressions
Date and TimeInput/OutputCollections
LoggingConcurrencyReflection
JARZIPVersioning
InternationalizationJNDIOverride Mechanism
Extension MechanismScripting

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.

Details

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

compact1compact2 Additionscompact3 Additions
java.iojava.rmijava.lang.instrument
java.langjava.rmi.activationjava.lang.management
java.lang.annotationjava.rmi.dgcjava.security.acl
java.lang.invokejava.rmi.registryjava.util.prefs
java.lang.refjava.rmi.serverjavax.annotation.processing
java.lang.reflectjava.sqljavax.lang.model
java.mathjavax.rmi.ssljavax.lang.model.element
java.netjavax.sqljavax.lang.model.type
java.niojavax.transactionjavax.lang.model.util
java.nio.channelsjavax.transaction.xajavax.management
java.nio.channels.spijavax.xmljavax.management.loading
java.nio.charsetjavax.xml.datatypejavax.management.modelmbean
java.nio.charset.spijavax.xml.namespacejavax.management.monitor
java.nio.filejavax.xml.parsersjavax.management.openmbean
java.nio.file.attributejavax.xml.streamjavax.management.relation
java.nio.file.spijavax.xml.stream.eventsjavax.management.remote
java.securityjavax.xml.stream.utiljavax.management.remote.rmi
java.security.certjavax.xml.transformjavax.management.timer
java.security.interfacesjavax.xml.transform.domjavax.naming
java.security.specjavax.xml.transform.saxjavax.naming.directory
java.textjavax.xml.transform.staxjavax.naming.event
java.text.spijavax.xml.transform.streamjavax.naming.ldap
java.timejavax.xml.validationjavax.naming.spi
java.time.chronojavax.xml.xpathjavax.security.auth.kerberos
java.time.formatorg.w3c.domjavax.security.sasl
java.time.temporalorg.w3c.dom.bootstrapjavax.sql.rowset
java.time.zoneorg.w3c.dom.eventsjavax.sql.rowset.serial
java.utilorg.w3c.dom.lsjavax.sql.rowset.spi
java.util.concurrentorg.xml.saxjavax.tools
java.util.concurrent.atomicorg.xml.sax.extjavax.xml.crypto
java.util.concurrent.locksorg.xml.sax.helpersjavax.xml.crypto.dom
java.util.functionjavax.xml.crypto.dsig
java.util.jarjavax.xml.crypto.dsig.dom
java.util.loggingjavax.xml.crypto.dsig.keyinfo
java.util.regexjavax.xml.crypto.dsig.spec
java.util.spiorg.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

 

Don’t Forget to Share This Post!

Subscribe to foojay updates:

https://foojay.io/feed/
Copied to the clipboard