Topics and trends related to the Java ecosystem with occasional random rants.

  • Sun
    August 12, 2013

Compact Profiles Demonstrated

James Connors
Principal Solutions Consultant

Following up on an article introducing compact profiles, the video that follows demonstrates how this new feature in the upcoming Java 8 release can be utilized.  The video:

  • Describes the compact profile feature and the rationale for its creation.
  • Shows how to use the new jrecreate utility to generate compact profiles that can be readily deployed.
  • Demonstrates that even the smallest of profiles (less than 11MB) is robust enough to support very popular and important software frameworks like OSGi.

The software demonstrated is in early access.  For those interested in trying it out before the formal release of Java 8, there are two options:

  1. Members of the Oracle Partner Network (OPN) with a gold membership or higher can download the early access Java 8 binaries of Java SE-Embedded shown here.  For those not at this level, it may still be possible to get early access software, but it will require a qualification process beforehand.
  2. It's not as intimidating as it sounds, you can pull down the source code for OpenJDK 8, and build it yourself.  By default, compact profiles are not built, but this forum post shows you how.  The reference platform for this software is linux/x86.  Functionally, the generated compact profiles will contain the pared down modules for each compact profile, but you'll find the footprint for each to be much larger than the ones demonstrated in this video, as none of the Java SE-Embedded space optimizations are performed by default.

Not having any premium privileges on YouTube, the maximum allowed length of a video is 15 minutes.  There's actually lots more to talk about with compact profiles, including enhancements to java tools and utilities (javac, jar, jdeps, and the java command itself) that have incorporated intelligence for dealing with profiles.

Hmm.  Maybe there's an opportunity for a Compact Profiles Demonstrated Part II?

Join the discussion

Comments ( 4 )
  • Alexis MP Wednesday, August 14, 2013

    Thanks for taking the time to record this. It's great to see modularity progress in Java 8.

    Where are compact profiles defined and documented? Can I create my own?

    Have SDK tools (maybe javac itself) been enhanced to compute the smallest profile for a given application ?

    In other words was there a way to statically detect that Felix would not load the bundle on the compact1 profile?

  • guest Wednesday, August 14, 2013

    Hi Alexis,

    To your questions:

    1. In terms of documentation, the best place to look currently is the JEP (Java Enhancement Proposal for Compact Profiles http://openjdk.java.net/jeps/161). If you have access (OPN Gold) to the early access builds, there is some additional documentation in the bundle.

    2. For Java 8 we are providing 3 defined subsets of the JRE and providing a tool called jrecreate that will enable you to do some customizations on the defined profiles themselves. For example, you can choose the type of VM (minimal, client, server) the should be associated with the created profile. The ability to create your own custom runtime based on the profile of your application is a feature we will be providing in Java 9.

    3. Compact Profiles bring with it a series of enhancements to Java development tools. In particular, "javac -profile" will check to see if your source code references an api not in the specified profile. If that is the case, javac will not compile the source.

  • guest Thursday, February 20, 2014

    Video link seems to be missing.

  • guest Friday, February 21, 2014

    Try it now. Looks like Embedded YouTube URLs must now use https. Formerly it was http.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.