Setting up a local SalesForce developer environment on Mac using Homebrew

I’ve just started a new role working with a SalesForce package and there are times when I need to drop into the code-level space to investigate what’s going on. Setting up a local SalesForce developer environment on MacOS doesn’t need to be hard! Here’s some quick steps to get you up and running in minutes…
Prerequisites: These instructions were written for MacOS 10.15.
You’ll need Homebrew and VSCode installed.
Installing the tools
- Tap the keg:
# brew tap AdoptOpenJDK/openjdk
- Install the required tools:
Note: The SalesForce CLI only supports JDK 8 or 11.# brew cask install sfdx openjdk11
- Confirm the installation was successful:
# which java
/usr/bin/java - Confirm the JDK version:
# java —-version
openjdk 11.0.8 2020–07–14 - Find the full location of the Java SDK runtime:
# /usr/libexec/java_home -V
Matching Java Virtual Machines (1):
11.0.8, x86_64: "AdoptOpenJDK 11" /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
Configuring VSCode
- Install the Salesforce Extension Pack
Open VSCode > Code menu > Preferences > Extensions - Search for and Install the Salesforce Extension Pack
- Open VSCode Settings:
Code menu > Preferences > Settings - Find the Salesforcedx-vscode-apex > Java: Home setting, and set it to the location returned in Step 5. It should look something like this:
