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
https://discuss.circleci.com/t/android-convenience-image-moving-to-java-v11-on-august-17th/36601

This documentation from the eclipse organization may be helpful (
https://www.eclipse.org/openj9/docs/xxusecontainersupport/ 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 support@circleci.com and we can help you through this process.

Was this article helpful?
3 out of 5 found this helpful

Comments

0 comments

Article is closed for comments.