Build Android on Java 11 on Ionic Framework

Our company builds and deploys a product via Ionic Framework.
Recently we upgrades cordova-android plugin in our cordova app to version 10.1.0 and targetSdk to 31. We have an issue with building at latest build stack, because of Java assertion error:

An exception has occurred in the compiler (1.8.0_312). Please file a bug against the Java compiler via the Java bug reporting page ( after checking the Bug Database ( for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class$NameImpl)

Locally I have been able to resolve this issue by setting JAVA_HOME env variable to Java 11 location. I have not been able to do this on Ionic Framework. Is there any way to tell builder to use Java 11 at build?

Thank you!