Error while running Flutter app

collageleaveapp-2496566:~/collage_leave_app{master}$ flutter run
Connected devices:
Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
Android SDK built for x86 (mobile) • localhost:5555 • android-x86 • Android 10 (API 29) (emulator)
[1]: Android SDK built for x86 (emulator-5554)
[2]: Android SDK built for x86 (localhost:5555)
Please choose one (or “q” to quit): 1
Launching lib/main.dart on Android SDK built for x86 in debug mode…

ERROR: JAVA_HOME is not set and no ‘java’ command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

Running Gradle task ‘assembleDebug’… 34ms
Error: Gradle task assembleDebug failed with exit code 1
collageleaveapp-2496566:~/collage_leave_app{master}$

hey, I don’t think you need to do a flutter run in the terminal,
just make sure the localhost:5555 is listed as a available device,
that may require this in the terminal, adb connect localhost:5555
then go to the emulator refresh button, and do a hard-start,
then look at the output set to IDX, you should eventually get to see,
2024-08-29T20:54:41Z [android] :arrow_forward: Preview running
then your good to go, in hot reload mode, i believe , unless there is an error in your dart files, etc …