SpringBot: Setting Up Your Development Environment: Mac
The following steps will walk you through the process of setting up your development environment.
This lesson assumes you are running mac OS Mojave.
Approximate setup time is 30-40 minutes.
These are all the download links provided in this article. If you have a slow internet connection you may wish to begin downloading all items first to save time.
Any versions of java above 11 should work, however SpringBot has been built and tested with Java 11, as it is the latest version with long term support (LTS). This tutorial will use adoptOpenJDK 11 because it is open source and free for commercial use.
- Download an installer for adoptOpenJDK11 here:
Once the pkg file has finished downloading, double click to open and follow the installation wizard process.
Open a new terminal and check the Java version is correct:
If this does not work, you may have to update PATH to point to your latest Java installation.
Node and Angular
- Install Node. Download version 8 for macOS (file ending in
.pkg) using the direct download link or from the Node website. Open the installer and run through the setup.
- When this is complete open a new terminal and run
node -vwhich should output something like
v8.10.0depending on the version you downloaded.
(Optional) Install Angular CLI globally. This step is not strictly necessary, but provides ease of use. If you omit this step, all Angular CLI commands can be achieved by invoking the local version by prefixing all commands with
ng servewould become
npx ng serve.
To install, copy and paste the following into your terminal and press enter:
npm install -g @firstname.lastname@example.org
Note: Please contact us if you have any issues installing Angular globally.
- After this has finished, running
ng versionshould provide the following output:
- Download the complete version of Gradle version 5.2.1 from the direct download link, or from the Gradle website
Run the following commands to unzip the downloaded file
Note we are using the
/opt/gradledirectory, but you can choose to put it wherever you like as long as you replace the /opt path used in this article.
sudo mkdir /opt
sudo mkdir /opt/gradle
Open a new terminal by pressing (CMD + N) and navigate to Downloads
Run the following commands.
Note that your downloaded file may be named slightly differently. If so you will need to replace
gradle-5.2.1-all.zipwith what it is named in your downloads
sudo unzip -d /opt/gradle gradle-5.2.1-all.zip
Now you should see the following files:
LICENSE NOTICE bin getting-started.html init.d lib media
You will now need to add Gradle to your
PATHby running the command below
echo 'export PATH=$PATH:/opt/gradle/gradle-5.2.1/bin' >> ~/.bash_profile
To test that this has worked correctly, open a new terminal (CMD +N) and run the following command:
And you should see a line finishing with our new gradle directory:
postgreSQL is the database of choice for Springbot applications. This section will explain how to install and run it.
Download the package installer v11.5 for mac from the Direct Download Link
Or alternatively from the website
Open the downloaded dmg
If prompted, click open
Enter your username and password
Continue through the installer with the default settings:
- Enter bots as a password. You may use your own however this article assumes in future steps that you have set it to ‘bots’
- Leave the port set to it’s default of 5432
- Keep the [Default locale] selection
- Ensure that the settings for the installation match
- Continue and wait for the installation to complete
Untick “launch stack builder” and click finish
pgAdmin is a useful database explorer that works with postgreSQL. You can download the latest version from the Direct Download Link
Or alternatively you can download from the website
pgAdmin will open in your browser and request you set a master password.
You can set this to be anything as long as you remember it. We use the password ‘bots’ in these examples.
Create databases and roles
From here you can either use pgAdmin or the command line to create and manage your databases but this guide will use pgAdmin to interface with the database.
If you aren’t connected already, connect to the Postgres server using the password defined in the PostgreSQL install command above (
Right click on the local PostgreSQL server and select ‘Connect Server’:
Enter the password and press “OK”
We now need to create a new user and database in Postgres to allow Codebots target application to interact with.
Create a new “Login/Group Role”. Right click on the “PostgreSQL” server and select “Create” > “Login/Group Role…”:
Under the “General” tab, enter the “Name”
Click the “Definition” tab and enter the “Password”
Click the “Privileges” tab and set the “Superuser?” toggle to “Yes”:
Click “Save” to create the new Role.
Now to create the new database:
Right click on “Databases” and select “Create” > “Database…”:
Under the “General” tab, enter the “Database”
codebots” and select the “Owner”
Click the “Definition” tab and select the “Encoding”
Click “Save” to create the new Database.
If everything was executed properly you would have successful create database and user called codebots, like the image below.
This completes the server setup required to run your SpringBot application! You should now complete the lesson on how to setup your local development environment to start editing your SpringBot application. Then run your application on your SpringBot server!