Ionic 6 Android SDK Level 31 Not Working

@CGauns We were hoping you could share some insights on upgrading to Java 11. We’ve encountered a challenge while attempting to add Android as we’re being prompted to use SDK 1.8, and unfortunately, Java 11 isn’t supported we are getting compilation issue. We noticed that you had a similar issue, and we’d greatly appreciate it if you could kindly provide us with a detailed explanation of how you managed to upgrade.

We are stuck with the release, and having a problem ,Thankyou in advance.

Download the jdk v11 from oracle website
Then uninstall jdk v8
Install jdk v11
Go to your environment settings and make change the java home to jdk 11 directory

And in path to jdk v11 bin directory

Thankyou for Quick reply @Francolaz

I Installed java 11 and set java home to jdk 11 directory and all added jdk v11 bin
In Command prompt when I check java -version , I am getting Java 11 version number all those details , but when I go to Ionic project and do “ionic cordova build android --release --prod” then i am getting “Failed to find ‘JAVA_HOME’ environment variable. Try setting it manually.”

I am using Windows 10 OS
Visual Studio code editor
Ionic 6 Cordova
Angular 8

Note: If I used target SDK as V30 and if I build using Java 8 , APK is getting generated and working , But as Playstore stopped V30 I am facing these issues.