Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titleInstall Homebrew
collapsetrue
# navigate to your home directory
cd ~/

# create a homebrew folder in your home directory
mkdir homebrew

# download homebrew software into your new folder
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

eval "$(homebrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"

# add homebrew to zsh shell
echo 'export PATH="/Users/username/homebrew/bin:$PATH"' >> ~/.zshrc

# add homebrew to bash shell
echo 'export PATH="/Users/username/homebrew/bin:$PATH"' >> ~/.bash_profile

# if homebrew doesn't work immediately, don't worry, you just have to source the new path
source ~/.zshrc # if you are using zsh
source ~/.bash_profile # if you are using bash

# you can test with the following
brew --version

...

Code Block
languagebash
titleInstall Java
collapsetrue
# use homebrew to install Java
brew install java

# add Java to your PATH environmental variable, so your terminal knows where to find Java
echo 'export PATH="/Users/username/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc # if you are using zsh
echo 'export PATH="/Users/username/homebrew/opt/openjdk/bin:$PATH"' >> ~/.zshrc # if you are using bash

# you can test that it works with the following
java --version

...