title: Why brew installion failed?
body: <p>I installed java11 using Home Brew but that failed. So some help needed to get Java works!</p>
  <p>Thanks for advance!</p>
  <pre><code>admin@mac ~ % brew install java11
  Warning: openjdk@11 11.0.12 is already installed and up-to-date.
  To reinstall 11.0.12, run:  
  brew reinstall openjdk@11
  </code></pre>
  <p>Then brew reinstall java11</p>
  <pre><code> admin@mac  ~ % brew reinstall java11
      ==&gt; Downloading https://ghcr.io/v2/homebrew/core/openjdk/11/manifests/11.0.12
      Already downloaded: /Users/admin/Library/Caches/Homebrew/downloads/45acc78f00cc0cf39a75f562f544fd9b61dc415df386dd1cb9b886c1f553252d--openjdk@11-11.0.12.bottle_manifest.json
      ==&gt; Downloading https://ghcr.io/v2/homebrew/core/openjdk/11/blobs/sha256:dbf0b347060474c1aa0fbe3e58e33f4d81337e6f49209761da130ee776d66355
      Already downloaded: /Users/admin/Library/Caches/Homebrew/downloads/f08afa8f068cb282e649564e38b9fbe4aafc8e7f0d7b969fa17651c6df2f14e5--openjdk@11--11.0.12.arm64_big_sur.bottle.tar.gz
      ==&gt; Reinstalling openjdk@11
      ==&gt; Pouring openjdk@11--11.0.12.arm64_big_sur.bottle.tar.gz
      ==&gt; Caveats
      For the system Java wrappers to find this JDK, symlink it with
        sudo ln -sfn /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk
      
      openjdk@11 is keg-only, which means it was not symlinked into /opt/homebrew,
      because this is an alternate version of another formula.
      
      If you need to have openjdk@11 first in your PATH, run:
        echo 'export PATH=&quot;/opt/homebrew/opt/openjdk@11/bin:$PATH&quot;' &gt;&gt; ~/.zshrc
      
      For compilers to find openjdk@11 you may need to set:
        export CPPFLAGS=&quot;-I/opt/homebrew/opt/openjdk@11/include&quot;
      
      ==&gt; Summary
        /opt/homebrew/Cellar/openjdk@11/11.0.12: 670 files, 273.0MB
      ==&gt; Running `brew cleanup openjdk@11`...
      Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
      Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
  </code></pre>
  <p>After reinstall:</p>
  <pre><code>   admin@mac ~ % echo 'export PATH=&quot;/opt/homebrew/opt/openjdk@11/bin:$PATH&quot;' &gt;&gt; ~/.zshrc
  </code></pre>
  <p>And test java -version</p>
  <pre><code>admin@mac ~ % java -version
  The operation couldn’t be completed. Unable to locate a Java Runtime.
  Please visit http://www.java.com for information on installing Java.
  </code></pre>
  <p>Also:</p>
  <pre><code>admin@mac ~ %  sudo ln -sfn /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk
  Password:
  ln: /Library/Java/JavaVirtualMachines/openjdk-11.jdk: No such file or directory
  </code></pre>