Hi there,
I run Flutter in VS Code, and have been having no issues until today. All of a sudden I cannot build to Android. I've been building to 3 different Android devices (1 emulator; 2 devices (one USB; one wireless)) since I got my MBP (came with Big Sur) a couple months ago. Today it can't find Java.
Research says to check the Java icon in the System Preferences. But there is no Java icon in my System Preferences.
The error is:
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
I also tried a different project via Android Studio, and it says the same thing. But I've BEEN building to Android, so I'm completely confused why today it all of a sudden can't find Java.
When I type which java or which javac they both point to /usr/bin/java and /usr/bin/javac. But typing java -version or /usr/bin/java -version gives that same error.
I went to Oracle, but they mention about costs. And this again makes me wonder... why am I even here?? Where did my Java go?
I also don't surf the web or download/install stuff on my Mac. I only do Flutter development on the Mac.
So do I just not think about how it disappeared, and go ahead and just install the JRE or JDK from Oracle? Or is there a way to tell the Mac to "please fix this"?
Thanks for any insights. -Keith