Java SE Embedded 8 Compact Profiles Overview


Java SE Embedded 8 introduces a new concept called, Compact Profiles, which enable reduced memory footprint for applications that do not require the entire Java platform. The Java SE 8 javac compiler has a new -profile option, which allows the application to be compiled using one of the new supported profiles.

There are three supported profiles: compact1, compact2 and compact3. These are additive layers, so that each Profile contains all of the APIs in the previous smaller Compact Profiles and adds appropriate APIs on top. The compact profiles feature is useful in small devices. It also can be used to shorten the time to download an application from a download server, such as an "App Store."  It makes for more compact deployment of Java applications that bundle the JRE. A JRE can be configured with a compact profile, reducing its footprint for deployment along with a compact profile application.


A compact profile is a subset of the full Java SE Platform API. Because they have a smaller storage footprint, compact profiles can enable many Java applications to run on resource-constrained devices. Choosing a compact profile that closely matches an application's functional needs minimizes the storage devoted to unused functions.  There are new embedded developer tools in Java SE Embedded 8 including jrecreate and jdeps, which allow a developer to customize the Compact Profile runtime environment for a platform, and to find the Compact Profile dependencies for analysis during platform development.

Compact profiles address API choices only; they are unrelated to the Java virtual machine, the language proper, or tools.  So, care must be taken to match the Java virtual machine supported functionality with the API support needed.

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 Input Methods IDL
  Preferences Accessibility Print Service
  Sound Swing  
  AWT Drag and Drop  
  Image I/O  JAX-WS  
compact3 Security1 JMX JNDI
  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 JNI 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:

Detailed Profile Composition

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

Understanding which Compact Profile to Use 

When developing applications for Compact Profiles, you must remember to only use the APIs found in the specifications for compact1, compact2, or compact3 profiles.  Refer to the above Detailed Profile Comparison to see which Java packages exists in which Compact Profile.  To ease in the programming of embedded apps for Compact Profiles, you can use the "jdeps" tool to see which Java packages are being used inside your source code after you have written your app.  The result of running jdeps on your Java app will allow you to see which Compact Profile runtime you will need to be able to execute your application.

Using the jdeps Tool

The following shows the usage of the jdeps tool:

$ jdeps
Usage: jdeps <options> <classes...>
where <classes> can be a pathname to a .class file, a directory, a JAR file,
or a fully-qualified classname or wildcard "*".  Possible options include:
  -s         --summary                 Print dependency summary only
  -v         --verbose                 Print additional information
  -V <level> --verbose-level=<level>   Print package-level or class-level dependencies
                                       Valid levels are: "package" and "class"
  -c <path>  --classpath=<path>        Specify where to find class files
  -p <pkg name> --package=<pkg name>   Restrict analysis to classes in this package
                                       (may be given multiple times)
  -e <regex> --regex=<regex>           Restrict analysis to packages matching pattern
                                       (-p and -e are exclusive)
  -P         --profile                 Show profile or the file containing a package
  -R         --recursive               Recursively traverse all dependencies
             --version                 Version information


A typical way to use jdeps is to use "-P" to print out the profiles that are being used by your app so that you can see which Compact Profile you must use to execute your application.

For example, here is a typical run of jdeps to discover which Compact Profile is the minimal that must be used to run the program:

% jdeps -P HelloWorld.class
HelloWorld.class -> /net/
   <unnamed> (HelloWorld.class)
      ->                                            compact1
      -> java.lang                                          compact1

The results in the above example show that the compact1 profile is the minimum profile required to run the HelloWorld application.  Therefore, the HelloWorld app must be run with compact1 Java SE Embedded 8 runtime.

Oracle Java SE Embedded version 8

Oracle Java SE Embedded version 8 Download

More Information

Other Java SE Embedded Downloads

Java SE Embedded System Requirements

Technical Documentation for Java SE Embedded is included in the download bundle for your convenience.
Java SE Embedded documentation can also be accessed online:

Java SE Embedded Documentation