最近在弄Flutter的开发环境,运行`flutter doctor`, 报了一个错。
Unable to find bundled Java version
网上搜寻了一下,有个解决方法是这个:
macOSGo to the Finder's tab bar and move the mouse to the File tabClick the "Find" buttonSearch for the term "Android Studio"Right click and click the "Show Package Contents" buttonCreate a new folder called "jre"Copy the contents of the "jbr" folder and paste them into the "jre" folderWindowsGo to C:\Program Files\Android\Android StudioCopy the contents of the "jbr" folder and paste them into the "jre" folder
这个看起来,问题很好解决,按照这个描述,一步步操作,就可以解决问题。
然而,我在第一步,就遇到了问题: 找不到 Android Studio的安装位置。
我是通过Jetbrains Tool 安装的Android Studio。 也就是说,在Mac 电脑的Applictions里找不到Android Studio的安装位置。通过Finder中的finder查找功能,确实找到了Android Studio, 但点进去后,根本没有 jbr 目录。
捣鼓了好些时间,最后在jetbrains tool里找到了Android Studio的真正安装目录。
在jetbrains tools中,Android Studio行,进入设置界面,就可以看到具体的安装位置。
进入安装目录,很顺利就找到了 jbr 目录。然后就照着教程一步步操作,就可以了。