Reputation: 1
I set a new JAVA_HOME path in the System Environment Variables, since the old one was too outdated. However when I run flutter run in the terminal, it logs this message:
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jre1.8.0_431
Please set the JAVA_HOME variable in your environment to match the location of your Java installation. Running Gradle task 'assembleDebug'... 54ms Error: Gradle task assembleDebug failed with exit code 1
The current JAVA_HOME path is "C:\Program Files\Java\jdk-11.0.2" (which also shows when I run java -version command in cmd).
How do I change the path Android Studio stil points to?
I tried:
What went wrong When trying to run my current Flutter project, terminal logs that the JAVA_HOME directory is invalid (as mentioned before)
Upvotes: 0
Views: 79