Its a simple solution. in vscode terminal run flutter config --jdk-dir "C:\Program Files\Java\jdk-23" Change the Path to the path where your Java is installed, and which jdk you have. This will allow you to then run flutter doctor --android-licenses
You do have to make sure you have setup your enviroment variables under system variables. Again, be sure to change the location depending on your Java installation.
JAVA_HOME C:\Program Files\Java\jdk-23
Path = C:\Program Files\Java\jdk-23\bin