admin管理员组

文章数量:1418922

i have downloaded jdk8 and the environment variables is set correctly

java -version java version "1.8.0_431" Java(TM) SE Runtime Environment (build 1.8.0_431-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.431-b10, mixed mode)

javac -version javac 1.8.0_431

JAVA_HOME : "C:\Program Files\Java\jdk-1.8"

but when i run flutter run i get this error: ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk-21 Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

i was using jdk21 but now i need to use jdk8 to run the project. i have tried every possible solution i think.

本文标签: javaFlutter run JAVAHOME is set to an invalid directoryStack Overflow