CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit


(x86 only)

Use this command line option to choose whether AOT code should be generated using an older processor (Intel® Sandybridge) feature set on the x86 platform, which therefore allows the AOT code to be portable; it can be run on any Intel Sandybridge or newer processor without you having to choose a machine with a suitably old processor for generating the AOT code.

This feature is particularly relevant for packaging a shared classes cache into a container image (for example, applications deployed on the cloud in the form of Docker containers) because the processor on which the container image is built is likely to be different from the processor on which the container is deployed.


Setting Effect Default
-XX:+PortableSharedCache Enable See notes that follow
-XX:-PortableSharedCache Disable

Default settings

This option is enabled by default in containers. To disable the option in a container, specify -XX:-PortableSharedCache.

The option is disabled by default outside containers. To enable the option outside a container, specify -XX:+PortableSharedCache for the initial JVM instance (when the creation of the shared class cache happens) as well as for every subsequent instance that makes use of the same shared class cache.