Introduction to the Labs¶
Welcome to the lab exercises!
Before you start any of the labs, you'll need a recent version of Java 8 installed (later versions might work, but the labs have only been tested with Java 8).
Java Installation Check¶
Let's first make sure that your Java Development Kit (JDK) is installed and available.
At the command prompt/terminal, type the following
java -version
If all is well, you'll see something like:
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
And let's make sure the Java compiler (javac
) is also working:
javac -version
Should result in:
javac 1.8.0_161
Problem?
If you get a "command not found", then Java either wasn't installed properly or is not on your path. See here for installation instructions and troubleshooting.
Spring Tool Suite¶
We'll be using the Spring Tool Suite (STS), which is a development environment based on Eclipse.
Download and install the STS 3.9.5 from here: https://spring.io/tools/sts
Install Buildship for Gradle Support¶
We'll be using Gradle, so you'll also need to download the Gradle extension for use inside of STS.
-
Click on the
Help
menu and chooseEclipse Marketplace...
-
Search for the Buildship Gradle Integration 2.0 extension by typing
Buildship
in the find box:
-
Click the
install
button -
If it's already installed, you'll see
Installed
displayed.
Buildship Details: For more information, you can go to: http://marketplace.eclipse.org/content/buildship-gradle-integration):
Clone MealKiosk Repo¶
From your Git command line, clone the repository:
C:\training> git clone https://github.com/spiral-learning/mealkiosk.git
Import Into Spring Tool Suite¶
-
From the
File
menu, chooseImport...
-
Type in
gradle
for the import wizard -
Select
Existing Gradle Project
and clickNext
-
On the next screen, just click
Next
-
Use the
Browse
button to point to where you cloned the project -
Click on
Finish
Run JUnit Tests¶
- In the Package Explorer, right-click on src/test/java
- Select
Run As
and thenJUnit Test
All tests should pass.