You can’t use Java 9 , Android only supports till Java 8 . You should use the JDK version that comes with Android Studio, NO need for side alone JDK.
Read moreIs it free to update Java?
Java 17 available now Java 17 LTS is the latest long-term support release for the Java SE platform. JDK 17 binaries are free to use in production and free to redistribute, at no cost , under the Oracle No-Fee Terms and Conditions. JDK 17 will receive updates under these terms, until at least September 2024.
Read moreHow do I install Java on Mac?
Install Java on Mac
Read moreWhich JDK version should I use for Android Studio?
Set the JDK version A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and higher , and this is the JDK version we recommend you use for your Android projects.
Read moreHow do I edit project SDK?
Change Android Studio project JDK
Read moreCan you still update Java?
Generally speaking it should be safe to upgrade to the latest Java Runtime Environment (JRE) for your operating system , then uninstall previous releases using the “Java Uninstall Tool.” The Java Uninstall Tool will automatically figure out which releases are no longer required and remove them for you.
Read moreHow do I update Java from 1.8 to 11?
Migrating to Java 11 from Java 8
Read more