Steps to reproduce
- Error.
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/openjdk-11
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Exception: Gradle task assembleDebug failed with exit code 1
I went to this directory and found
- after changing the defalut java home path, i still get this error.
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/openjdk-11
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Exception: Gradle task assembleDebug failed with exit code 1
Code sample
ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/openjdk-11
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Exception: Gradle task assembleDebug failed with exit code 1
Expected results
The Default JAVA-HOME path should change in android studio too, since i have changed it on my computer. at least that what i think should happen.
Actual results
I get the same error which contain the previous directory



The Problem is solved by Upgrading the Flutter SDK