Skip to content

Instantly share code, notes, and snippets.

@DaddyMoe
Last active December 9, 2023 00:30
Show Gist options
  • Save DaddyMoe/cf927a91ac60f9902b03fa23ee6e578d to your computer and use it in GitHub Desktop.
Save DaddyMoe/cf927a91ac60f9902b03fa23ee6e578d to your computer and use it in GitHub Desktop.
Environment setup for Java Software Development on a MacOS
Either follow this simple guide here or leverage other heavily oppinionated guides that are more comprehensive and community supported
# Option 1: Community support versions
First follow [xmlking's complete Mac setup](https://xmlking.gitbook.io/macos-setup/applications/sublime-text)
- General mac setup
- System preparedness and preferences - folders setup etc
- Application installations
There is another guide [here @sourabhbajaj](https://sourabhbajaj.com/mac-setup/SublimeText/Preferences.html)
to check reference for additional configurations
## What I do in addition
Download
- Docker desktop: https://www.docker.com/products/docker-desktop/
- Google Chrome
- Office 365 apps: https://portal.office.com/account#
# Option 2: Keep it simple
## Homebrew
- Brew [installation](https://docs.brew.sh/Installation.html)
- Install cask `brew tap caskroom/cask`
### The bunch
brew install \
python \
tree \
cask \
wget \
bash-completion \
git \
watch \
htop \
tldr \
jq \
ncdu \
zsh \
speedtest-cli \
midnight-commander \
firefox \
node \
sudo easy_install pip
xcode-select --install
brew cask install iterm2
# brew install docker -- favour the official install instead: https://docs.docker.com/docker-for-mac/install/
### Cask installs
First, fetch the latest version of homebrew and formula. Then tap the Caskroom/Cask repository from Github. After that search for the <package> and then install
brew update
brew tap homebrew/cask
brew search visual-studio-code
brew install visual-studio-code
brew cask install sublime-text
## [Oh My Zsh!]
(Official site here)(https://ohmyz.sh/#install).
Whiilst on it remember to install [the poweline fonts](https://github.com/powerline/fonts) for the advance zsh themese like Agnostic to work well. This would install my favourite font: SourceCodePro
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
### Apply Theme
ZSH_THEME="fino-time"
### Apply plugins
plugins=(
git
git-extras
gradle
history
helm
iterm2
sublime
jenv
kubectl
man
mvn
nvm
postgres
python
docker
docker-compose
docker-machine
brew
cask
cp
gcloud
sudo
yarn
)
### Example usage:
- speedtest-cli --simple --bytes
- lunch midnight commander with `mc`
## Java
### Official download
[Oracle Java archive](https://www.oracle.com/technetwork/java/javase/archive-139210.html)
### Installing Java using Homebrew
Since the addition of a [Openjdk formulae](https://discourse.brew.sh/t/how-to-install-openjdk-with-brew/712/24),
all you now need is below making brew cask ... unneccessary:
brew install openjdk # or
brew install openjdk@11 # <--Specify version like so
Then following the instructions from the output on completion e.g:
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
### Configure Jenv
jenv add /Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home #adds latest version
jenv add /usr/local/Cellar/openjdk@11/11.0.9/
jenv global 11.0.9 # Sets default version
cat ~/.jenv/version # verify global files is written
jenv versions # verify versions
#### Deprecated/alternative means
brew cask install java # Auto install the latest Oracle JDK
brew cask info java # Verify latest version for auto installation
brew cask install java8 # installs a specific version
### To install the JDKs from AdoptOpenJDK:
brew tap adoptopenjdk/openjdk
brew cask install adoptopenjdk8
brew cask install adoptopenjdk9
brew cask install adoptopenjdk10
brew cask install adoptopenjdk11
### Add new version to Jenv
1. Check versions `jenv versions`
1. Add `jenv add /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home`
[Jenv for more](https://www.jenv.be)
# Bonus
[Beautiful terminal guide](https://medium.com/@Clovis_app/configuration-of-a-beautiful-efficient-terminal-and-prompt-on-osx-in-7-minutes-827c29391961)
# Mics
Consider the M1 cheap vs intel considerations in this [setup guide here](https://gist.github.com/jabrielcjones/71c5dad92387682f4176e0a1ec91b6bf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment