I tried to run npx expo run:android
on my build but it returned with this error. I have the Android Studio emulator installed and Java. I am running this on VSCode. How do I fix this?
Please never anywhere share screenshots of text if you only want to share the text and not something additional like colors or IDE annotations. Text in images is hard to read, especially on mobile, very hard to copy, and nearly impossible to search for.
Besides that, the error is imho quite clean.
You are using a JRE to run Gradle instead of a JDK and that is not supported.
Im sorry this is my first time posting. How do I switch to JDK instead of JRE?
I have no idea where npx or expo or whatever is actually triggering Gradle takes Java from, you have to ask communities about those. If it is like directly invoking Gradle, it is taken from JAVA_HOME
environment variable and if that is not set then the one found in PATH
is used.