Troubleshooting "Unable to find bundled Java version" Error in Flutter
When encountering the "Unable to find bundled Java version" error while using the flutter doctor command, it signifies a missing bundled Java version with Flutter. This often occurs after installing a newer version of Android Studio. To resolve this issue, follow the appropriate steps based on your operating system:
For Windows Users
Verify that your Java version is up-to-date and set correctly in your system's environment variables. To do this:
- Open Command Prompt and enter "java -version" to check your current Java version.
- Set the JAVA_HOME environment variable to point to the installed Java directory, typically C:Program FilesJavajdk-version.
- Add the bin directory of the JDK to your system's PATH environment variable.
- Restart your terminal and run "flutter doctor" again.
For Mac Users
For Mac users using JetBrains Toolbox:
- Set the JAVA_HOME environment variable to point to the JetBrains Runtime directory.
- Change username to your macOS username and run the following commands:
cd /Users/username/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/203.7583922/Android Studio.app/Contents/jre
ln -s ../jre jdk
ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
flutter doctor -v
- If the issue persists, try the following workaround:
cd /Applications/Android\ Studio.app/Contents
ln -s jbr jre
For other Mac users:
- Open Android Studio installer.
- Open "Configure."
- Scroll down to "Android SDK location" & "JDK location."
- Enter the directory path of the JDK.
- Install Android Studio.
- Run "flutter doctor" again.
The above is the detailed content of Why Is Flutter Showing an \'Unable to Find Bundled Java Version\' Error, and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn