Setting up a local SalesForce developer environment on Mac using Homebrew

Image for post
Image for post
Photo by Clément H on Unsplash

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.

  1. Tap the keg:
    # brew tap AdoptOpenJDK/openjdk
  2. Install the required tools:
    Note: The SalesForce CLI only supports JDK 8 or 11.
    # brew cask install sfdx openjdk11
  3. Confirm the installation was successful:
    # which java
    /usr/bin/java
  4. Confirm the JDK version:
    # java —-version
    openjdk 11.0.8 2020–07–14
  5. 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
  1. Install the Salesforce Extension Pack
    Open VSCode > Code menu > Preferences > Extensions
  2. Search for and Install the Salesforce Extension Pack
  3. Open VSCode Settings:
    Code menu > Preferences > Settings
  4. Find the Salesforcedx-vscode-apex > Java: Home setting, and set it to the location returned in Step 5. It should look something like this:
Image for post
Image for post
Be sure to only include the runtime folder path, not the actual runtime application!

Written by

Test Analyst, iOS Developer, Youth Worker & Coffee Lover. www.mitchwd.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store