JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_281\bin
Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
How to solve this problem??
JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_281\bin
Please set the JAVA_HOME variable in your environment to match the location of your Java installation.
How to solve this problem??
You need to explicity download and define the jdk version to be used in the code for running the flutter app.
I also faced the similar issue and below solutions works for me:
Install jdk 11 and add path to gradle.properties
file
org.gradle.java.home=C:\\Program Files\\Java\\jdk-11.0.11
This happens because your JAVA_HOME is not set correctly. -> It is essential to set the java path when working on android. so, Please find these steps below.
Go to system properties -> Advance -> Environment Variables ( or just type ENV in search )
Add variable name as "JAVA_HOME" and Variable value will be the directory of java sdk // (do go to bin folder just java folder)
Now I hope your issue will be fixed.