try use this command :flutter config --jdk-dir "your jdk path" which tells Flutter where to find the Java Development Kit (JDK) by manually setting the JDK path it means you don't need to put the link on JAVA_HOME
flutter config --jdk-dir "your jdk path"