I am trying to set up flutter with VS Code in Ubuntu. I have followed the installation guide and have installed the latest cmdline tools as required by the flutter doctor.
Now this is the output I get on running flutter doctor again
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
On running flutter doctor --android-licenses
I get the following error
java.lang.UnsupportedClassVersionError:
com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled
by a more recent version of the Java Runtime (class file version 61.0),
this version of the Java Runtime only recognizes class file versions up to 55.0
I tried upgrading to Java 17 using sudo apt install openjdk-17-jdk
and set up the environment variables but the problem still persists.