Unable to find bundled Java version in flutter in ubuntu

43 views Asked by At

Setting up Flutter on ubuntu when run flutter doctor does not find java version.

abdelrahman@abdelrahman-wael:~$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 3.4.0-17.2.pre, on Ubuntu 22.04.3 LTS
    6.2.0-37-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (version 2022.3)
    ✗ Unable to find bundled Java version.
[✓] VS Code (version 1.84.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

I have java.

abdelrahman@abdelrahman-wael:/snap/android-studio/128/android-studio$ java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04)
OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)

In directory /snap/android-studio/128/android-studio/ I try this command

abdelrahman@abdelrahman-wael:/snap/android-studio/128/android-studio$ sudo ln -s ../jre jdk
[sudo] password for abdelrahman: 
ln: failed to create symbolic link 'jdk': Read-only file system

In flutter/packages/flutter_tools/lib/src/android/android_studio.dar' I try add globals.fs.path.join(directory, 'jbr', 'Contents', 'Home') I also removed the && version.major < 2020

0

There are 0 answers