Java Builds Fail With `Unrecognized VM option 'UseCGroupMemoryLimitForHeap'`


Java builds fail with the error:

Unrecognized VM option 'UseCGroupMemoryLimitForHeap'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

On August 17th, 2020 CircleCI updated the Android convenience image from Java JDK 8 to JDK 11. 
UseCGroupMemoryLimitForHeap has been removed completely in JDK 11 and replaced with UseContainerSupport.

Customers should modify their Java options to make use of UseContainerSupport instead.

You can read more about our announcement of this change here:

Android Convenience Image Moving to Java v11 on August 17th

This documentation from the eclipse organization may be helpful for more information on this feature:


An additional, but not directly related issue to the above error, is that you may need to increment your cache keys `restore_cache`, `save_cache` as there may have build data from Java 8 that will also cause build issues from the upgrade.

As always, please do feel free to reach out to submit a ticket to CircleCI Support and we can help you through this process.

Was this article helpful?
14 out of 23 found this helpful



Article is closed for comments.