SETUP A
DEVELOPMENT
ENVIRONMENT
INSTALL A
TERMINAL APP
INSTALL A TERMINAL APP
Many of the commands used in this course are based on Unix
On Windows you'll need to use PowerShell of install a modern terminal App, e.g., cmder.net
JAVA DEVELOPER
KIT 8 (JDK8)
DOWNLOAD AND INSTALL JDK 8
We will be using the latest version of Java throughout the semester
Navigate to Oracle's Java Development Kit (JDK) 8 download website
http://www.oracle.com/technetwork/java/javase/downloads/index.html
DOWNLOAD AND INSTALL JDK 8
$ java -version�java version "1.8.0_77"�Java(TM) SE Runtime Environment�(build 1.8.0_77-b03)
SETUP
MAVEN
DOWNLOAD AND INSTALL MAVEN
Maven is a Java dependency package manager. It simplifies managing the lifecycle of projects such as downloading libraries, compiling, running automated tests, and packaging projects for deployment. Download maven from
http://maven.apache.org/download.cgi
After installing, make sure the following command should print the version of maven
$ mvn –version
SETUP
HEROKU
FOLLOW HEROKU'S INSTALLATION GUIDE
Create a free account at https://www.heroku.com/
Heroku's spring boot guide can be found at
https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku
Select your operating system and�click on the download button
Double click on�heroku-osx.pkg when it's done downloading
Accept all defaults
FROM A TERMINAL WINDOW, LOGIN TO HEROKU
$ heroku login
heroku-cli: Updating to 6.99.0-ec9edad...
Enter your Heroku credentials:
Email: jannunzi@gmail.com
Password: **************
Logged in as jannunzi@gmail.com
jannunzi$
SPRING BOOT SETUP
ON macOS, INSTALL THE SPRING CLI USING BREW
Install the Spring CLI as described in their documentation
On macOSX, use brew to install spring boot
$ brew tap pivotal/tap�$ brew install springboot
If you don't have brew, on macOS, install it as follows:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
CREATE A COURSE DIRECTORY
Create a directory where to do all your work for this course
In your home directory, create a folder called webdev, e.g.,
$ mkdir webdev�$ cd webdev
In the new webdev folder, create another folder for this semester, e.g., f21 for fall 2021
$ mkdir f21�$ cd f21
CREATE A WEB APP USING THE SPRING CLI
From a command line terminal, use the spring command to create a simple spring web app called myapp, and then change to the new directory
$ spring init --dependencies=web myapp
$ cd myapp
CREATE A WEB APP USING THE SPRING CLI
On a Unix based machine, create a landing Web page:
$ mkdir src/main/webapp
$ cat > src/main/webapp/index.html
<h1>Welcome</h1>
Ctrl+c (that's the control key and C key)
On a Windows machine, you might need to use backslashes:
$ mkdir src\main\webapp
$ cat > src\main\webapp\index.html
<h1>Welcome</h1>
BUILD AND RUN THE APP
Ctrl+c (that's the control key and C key)
$ mvn clean install
$ java -jar target/myapp-0.0.1-SNAPSHOT.jar
Point your browser to http://localhost:8080/index.html
MYSQL WORKBENCH
MySQL WORKBENCH
SPRING TOOL SUITE
(OPTIONAL)
DOWNLOAD AND INSTALL SPRING TOOL SUITE (STS)
If you don't already have�STS, download STS from
https://spring.io/tools/sts/all
Select your OS, and download the installer
Double click the downloaded installer and accept all the defaults
Move the STS application to Applications and start it
NODE.JS
DOWNLOAD AND INSTALL Node.js (macOS)
Homebrew makes the process of installation of Node a one-step process. By using Homebrew, we do not need to manually add the path of node executable.
Step1: From the terminal execute the command:�$ brew install node
Node is installed on your system now.
Test the installed packages (Restart your computer)
Test Node: open command prompt and type node -v. You should see the downloaded version of node as “v7.3.0”
Test NPM: In command prompt, type npm -v. You should see the downloaded version of npm as “3.10.10”
DOWNLOAD AND INSTALL Node.js (Windows)
Test the installed packages (Restart your computer)
Test Node: open command prompt and type node -v . You should see the downloaded version of node as “v7.3.0” (the version you just downloaded in previous step).
Test NPM: In command prompt, type npm -v. You should see the downloaded version of npm as “3.10.10” (the version you just downloaded in previous step).
MONGODB
DOWNLOAD AND INSTALL MONGO DB (macOS)
$ brew update, $ brew tap mongodb/brew, $ brew install mongodb-community
Start the Mongo server: Open the terminal and run the command $ mongod to run the Mongo daemon. Verify that the MongoDB has started successfully by looking at following line in the console output:
[initandlisten] waiting for connections on port 27017
To stop the Mongo daemon hit ctrl+c
Connect to MongoDB: Once the Mongo server starts, start the mongo shell by executing $ mongo in the terminal. On starting the Mongo shell, the application will have access to data in MongoDB. To exit the Mongo shell run quit().
DOWNLOAD AND INSTALL MONGO DB (Windows)
DOWNLOAD AND INSTALL MONGO DB (Windows)
Start the Mongo server: Open command prompt and start the mongo server by running the exe file “mongod.exe” as follows:
> "C:\Program Files\MongoDB\Server\3.6\bin\mongod.exe"
Verify that the MongoDB has started successfully by looking at following line in the console output:
Connect to MongoDB: Once the Mongo server starts, open another command prompt and connect to MongoDB by running the exe file “mongo.exe” as follows:
> "C:\Program Files\MongoDB\Server\3.6\bin\mongo.exe"
GITHUB
CREATE GITHUB REPOSITORIES
Head over to github.com and create an account (if you don't already have one)
Each technology stack and type will have a its own github repository, e.g.
CREATING A GITHUB REPOSITORY
Navigate to your github.com account, click on Repositories, then on New
Name it based on the course, semester, your name, and role of the repo, e.g.,
cs1234-spring-2048-server-java-jannunzi
CREATING A GITHUB REPOSITORY
From the root of your local project, copy and paste github's sample commands:
echo "Describe the app" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/jannunzi/cs1234-sp19-...-jannunzi.git
git push -u origin master
RELEASES
To create a release, go to your repo, click on Releases, Create a new release
In Tag version type the name of the assignment you are submitting, e.g., assignment1
For instance, here's an example release from one of my courses
https://github.com/jannunzi/webdev-summer1-2018-java-server-jannunzi/releases/tag/M1L2
This is what you would submit in blackboard