The general process of setting up and using a development machine is described in
Set Up a Development Machine. This topic provides additional guidance to use when setting up an OSX machine for LabKey development.
Software Installation
1. Install the Apple command line developer tools, which include git:
2. GitHub for OSX
You can use GitHub Desktop or another Git client.
Install GitHub Desktop:
Install a command-line git option for your platform:
3. Java for OSX
Download the appropriate version and variant (x64 or aarch64 depending on your CPU type) of the recommended version of Java:
4. PostgreSQL Database
- Install the latest supported version of the PostgreSQL database.
- Take note of the username/password you select during installation.
- Mac:
- Linux:
- Install PostgreSQL using your Linux machine's native tools or download a binary package. Follow the instructions in the downloaded package to install PostgreSQL.
- Docker:
- You can also run PostgreSQL in a Docker container. On a Mac, use a folder in your home directory for the database files, for example, ~/development/pgdata:/var/lib/postgresql in place of C:/labkey/pgdata:/var/lib/postgresql.
5. Set up environment variables:
We use <LK_ENLISTMENT> to refer to the location where you placed your enlistment. Substitute it where shown.
- Add this location to your PATH: <LK_ENLISTMENT>/build/deploy/bin
- This directory won't exist yet, but add it to the PATH anyway. The Gradle build downloads binaries used by the server, such as graphvis, dot, and proteomics tools, to this directory.
To add the environment variables using ~/.zshrc or ~/.bash_profile (depending on your default shell), edit the file and add the lines, customizing for your own local paths to your enlistment and java. Replace ## with the version number of the JDK you installed:
export JAVA_HOME=`/usr/libexec/java_home -v ##`
export LK_ENLISTMENT=/labkeydev/labkeyEnlistment
export PATH=$LK_ENLISTMENT/build/deploy/bin:$PATH
You may also want to
set the variable GIT_ACCESS_TOKEN in order to be able to use commands like "./gradlew gitCheckout".
Gradle
mkdir -p ~/.gradle
cp <LK_ENLISTMENT>/gradle/global_gradle.properties_template ~/.gradle/gradle.properties
- Note that Folders beginning with a period are hidden in Finder. To show them, press Command+Shift+Period (.).
IntelliJ IDEA
The setup for IntelliJ is described in the
common documentation. There may be differences for OSX, and version differences, including but not limited to:
- The menu path for setting path variables is IntelliJ IDEA > Settings > Appearance & Behavior > Path Variables.
- For the NODE_PATH path variable, use forward slashes, for example, <LK_ENLISTMENT>/build/.node/node-v#.#.##/bin/node
- When you configure the target JDK, browse to the JDK's home directory, for example, /Library/Java/JavaVirtualMachines/jdk-##/Contents/Home
- The shortcut for "Update Project" is Command+T.
Related Topics