Unable to find bundled Java version with flutter doctor, after updating Android studio Arctic Fox(2020.3.1) on M1 Apple Silicon
Solution 1:
The answer is already posted here.
For Mac User:
Set Java_Home
path using below article & then after applying this command.
after that type below command in terminal:
cd /Applications/Android\ Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
flutter doctor -v
Solution 2:
Here is a little fuller answer for everything I had to do to get Android Studio set up on my M1.
-
Install Android Studio to the Applications folder
-
Create a symbolic link to from the
jre
folder to a newjdk
folder. (Due to this bug)
cd /Applications/Android\ Studio.app/Contents/jre
ln -s ../jre jdk
- Set the
JAVA_HOME
environment variable
nano ~/.zshrc
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
source ~/.zshrc
-
Install Android SDK Command-line Tools (needed for accepting license)
-
At this point it should work now (assuming you've also added flutter to your path)
flutter doctor
Solution 3:
I did install a fresh version of JAVA SDK, flutter, Android Studio and run the below command directly on the terminal one by one to fix 'Unable to find bundled Java version. ' issue.
-
cd /Applications/Android\ Studio.app/Contents/jre
-
ln -s ../jre jdk
-
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
-
flutter doctor -v
Now, you should be able to see the error is disappeared in flutter doctor description in terminal.
Solution 4:
Run Flutter doctor, if there´s an error indicating that the java bundled can´t be found (specially if you have Android Studio version Artic Fox), run this commands if using Mac:
-
cd /Applications/Android\ Studio.app/Contents/jre
-
ln -s ../jre jdk
-
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
-
Flutter Doctor
Solution 5:
This solution is for M1 Mac User
- Find your local Java version by typing
/usr/libexec/java_home -V
. If didn't exist, install the latest ARM Java version here - Set Java_Home path (in my case jdk-17.0.1.jdk) by typing
/usr/libexec/java_home /Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
- Type all of these in terminal
cd /Applications/Android\ Studio.app/Contents/jre ln -s ../jre jdk ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
- Finally run
flutter doctor -v
to see all the details changes