Environment: I had a series of unexplainable errors on a macOS system running macOS Big Sur and while I was trying to run my application using this guide from the official VS Code website.
Issue: Every time I opened a certainly working project in VS Code (tested in the IntelliJ IDE), it was full of errors like String is not a known class or main method not defined in class etc.
Understanding the Problem: I quickly figured out that the issue has to do with the JDK being misconfigured, and now I had to figure out if the issue was in VS Code or Homebrew. The issue I suspected lied in VS Code and originated from my choice to use a JDK downloaded and managed by the Homebrew package manager. After verifying my Homebrew installation of the given cask and making sure system paths were set correctly, I was certain of the previously made assumption.
Solution: