Skip to content

Instantly share code, notes, and snippets.

@khun84
Created June 23, 2021 16:20
Show Gist options
  • Save khun84/e9268954851b187366ae0c9a4b35ef94 to your computer and use it in GitHub Desktop.
Save khun84/e9268954851b187366ae0c9a4b35ef94 to your computer and use it in GitHub Desktop.
Open JDK post installation setup
For the system Java wrappers to find this JDK, symlink it with
  sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

openjdk is keg-only, which means it was not symlinked into /usr/local,
because it shadows the macOS `java` wrapper.

If you need to have openjdk first in your PATH run:
  echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> /Users/Daniel/.bash_profile

For compilers to find openjdk you may need to set:
  export CPPFLAGS="-I/usr/local/opt/openjdk/include"

==> Summary
🍺  /usr/local/Cellar/openjdk/15.0.1: 614 files, 324.9MB, built in 8 minutes 39 seconds
==> Installing gradle
🍺  /usr/local/Cellar/gradle/6.7.1: 11,049 files, 251.9MB, built in 44 seconds
Removing: /usr/local/Cellar/gradle/6.2... (11,452 files, 239.9MB)
==> Caveats
==> openjdk
For the system Java wrappers to find this JDK, symlink it with
  sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

openjdk is keg-only, which means it was not symlinked into /usr/local,
because it shadows the macOS `java` wrapper.

If you need to have openjdk first in your PATH run:
  echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> /Users/Daniel/.bash_profile

For compilers to find openjdk you may need to set:
  export CPPFLAGS="-I/usr/local/opt/openjdk/include"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment