M2Macでのflutter環境構築時にJava versionエラーが出る

macをこの度買い替えflutterの環境構築をしようとした際に
Java versionエラーが発生した

## Android Studioを設定後flutter doctorを実行
``` 
~ % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 13.0 22A380 darwin-arm, locale
    ja-JP)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.
[!] Xcode - develop for iOS and macOS (Xcode 14.2)
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.
[✓] Chrome - develop for the web
[!] Android Studio (version 2022.1)
    ✗ Unable to find bundled Java version.
[✓] Connected device (2 available)
[✓] HTTP Host Availability
```
Unable to find bundled Java versionというエラーが出現、、
同じエラーが発生している記事を見たところシンボリックリンクを作成する
必要があるとのことだったので下記コマンドを実行して見ようとしたところ、、

```
% cd /Applications/Android\ Studio.app/Contents/jre
% ln -s ../jre jdk
% ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
```
最初のコマンドで
```
cd: no such file or directory: /Applications/Android Studio.app/Contents/jre
```
と怒られてしまう、、
そもそもjreファイルが作成されていないみたいなので新規ファイルを作成
→中身はContents内のjbrファイルからそのままコピー
もう一度下記コマンドを実行したところ今度は成功！
```
% cd /Applications/Android\ Studio.app/Contents/jre
% ln -s ../jre jdk
% ln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdk
```
さらにflutter doctor を実行したところ

```flutter doctor 
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 13.0 22A380 darwin-arm, locale
    ja-JP)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.
[!] Xcode - develop for iOS and macOS (Xcode 14.2)
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see
      https://guides.cocoapods.org/using/getting-started.html#installation for
      instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
```

これでjava versionのエラーが解決できました！

参考記事
https://code-graffiti.com/java-version-issue-on-flutter-doctor/