Skip to content

Instantly share code, notes, and snippets.

@bipin-nag
Created August 11, 2021 20:41
Show Gist options
  • Save bipin-nag/34518ec843b5b7f3bf29d37fd9d41ddb to your computer and use it in GitHub Desktop.
Save bipin-nag/34518ec843b5b7f3bf29d37fd9d41ddb to your computer and use it in GitHub Desktop.
macOS java setup
#!/bin/bash
brew install jenv
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(jenv init -)"' >> ~/.zshrc
source ~/.zshrc
brew install AdoptOpenJDK/openjdk/adoptopenjdk8
brew install AdoptOpenJDK/openjdk/adoptopenjdk11
brew install AdoptOpenJDK/openjdk/adoptopenjdk14
java -version
ls /Library/Java/JavaVirtualMachines
jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/
jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/
jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home/
jenv versions
jenv global 11
java -version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment