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
Customers should modify their Java options to make use of
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.