Mac - Quick Setup Guide for Development Environment

Development Environment
Jan 2025
macOSHomebrewDockerJavaPythonMavenGradle

"A comprehensive guide to setting up a development environment on macOS, covering essential tools and software."

Mac - Quick Setup Guide for Development Environment
Table of Contents

Essential tools for software development in macOS environment. (Below setup was being used for Apple Silicon and Intel Macs)

Initial System Configuration and Prerequisites

Before installing any development tools, install Homebrew and the required dependencies.

Install Homebrew

Homebrew is a package manager for macOS that simplifies the installation of software.

  1. Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. Add Homebrew to PATH: For Apple Silicon:

    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
    

    For Intel Macs:

    echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
    eval "$(/usr/local/bin/brew shellenv)"
    
  2. Update Homebrew and Install Prerequisites:

brew update
brew upgrade
brew install curl wget git openssl readline sqlite3 xz zlib tcl-tk

This command installs essential tools and libraries for development on macOS:

  • Core utilities: curl, wget, and git for downloading files and version control
  • Development libraries: SSL (openssl), compression (xz, zlib), database (sqlite3), and others

Programming Language Environments

SDKMAN: Java Development Kit and Build Tools

SDKMAN is a tool for managing parallel versions of SDKs. We'll use it to install Java 17, Maven, and Gradle.

  1. Install SDKMAN:
curl -s "https://get.sdkman.io" | bash
  1. Initialize SDKMAN: For Zsh (~/.zshrc):

    echo 'source "$HOME/.sdkman/bin/sdkman-init.sh"' >> ~/.zshrc
    source ~/.zshrc
    

    For Bash (~/.bash_profile):

    echo 'source "$HOME/.sdkman/bin/sdkman-init.sh"' >> ~/.bash_profile
    source ~/.bash_profile
    
  2. Install Java 17, Maven, Gradle:

sdk install java 17.0.8.1-tem
sdk install maven
sdk install gradle
  1. Verify Installations:
java --version
mvn --version
gradle --version

pyenv: Python Version Management

pyenv is a tool to manage multiple Python versions on your system.

  1. Install pyenv with Homebrew:
brew install pyenv
  1. Add pyenv to Shell Startup: For Zsh (~/.zshrc):

    echo -e '\n# pyenv setup' >> ~/.zshrc
    echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.zshrc
    echo 'eval "$(pyenv init --path)"' >> ~/.zshrc
    echo 'eval "$(pyenv init -)"' >> ~/.zshrc
    source ~/.zshrc
    

    For Bash (~/.bash_profile):

    echo -e '\n# pyenv setup' >> ~/.bash_profile
    echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
    echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
    echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
    source ~/.bash_profile
    
  2. Install and Set Python 3.12.3:

pyenv install 3.12.3
pyenv global 3.12.3
python --version

Containerization and Services

Docker: Containerization Platform

  1. Install Docker Desktop:
brew install --cask docker
  1. Verify Docker Installation:
docker --version
docker run hello-world

Development and Productivity Tools

Database Management: DBeaver

  1. Install DBeaver:
brew install --cask dbeaver-community

Code Editors and IDEs

  1. Visual Studio Code:
brew install --cask visual-studio-code
  1. IntelliJ IDEA Community Edition:
brew install --cask intellij-idea-ce

Utility Applications

Web Browser: Google Chrome

  1. Install Google Chrome:
brew install --cask google-chrome

Office Suite: LibreOffice

  1. Install LibreOffice:
brew install --cask libreoffice

System Cleanup and Maintenance

brew cleanup

Conclusion

This guide provides a comprehensive setup for a robust macOS development environment. Feel free to customize the tools and versions according to your specific needs. Remember to:

  • Keep your system and tools updated
  • Refer to official documentation for specific tool configurations
  • Customize the setup to match your development workflow

Pro Tip: Use version managers like SDKMAN and pyenv to easily switch between different language versions and maintain project-specific environments.