I once had a problem with Flutter and I had to download jdk. I gave it a path D:/jdk but then i made new partition and downloaded it again on C:\Program Files\Java\jdk-16.0.1. Now when I'm running an app in Visual Studio Code there is an error:
FAILURE: Build failed with an exception.
What went wrong: Supplied javaHome must be a valid directory. You supplied: D:\jdk
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
I don't know what do, I already reinstalled gradle, jdk and VSCode. Whjat I have to do to delete this path from VSCode memory?
EDIT: FIXED
So I fixed the problem by deleting temporal files, optimalizing storages and clearing Windows cache (also cache of VSCode). I also restarted my laptop after the process
I answered this question with a link to tutorial how to do it, there are also additional steps like doing it with some program, in my case it wasn't required. Hope it helps someone