Skip to content

Latest commit

 

History

History
77 lines (55 loc) · 3.89 KB

File metadata and controls

77 lines (55 loc) · 3.89 KB

Project Setup Guide

Welcome to our project! This guide will walk you through the setup process and explain some of the tools we use.

Introduction

We're using Maven for this project for several reasons:

  • It handles our H2 database dependency automatically.
  • It ensures we're all using the same JDK version.
  • It integrates well with both Visual Studio Code and Eclipse.

JDK 17

We're using JDK 17 for this project. To check the installed JDK version on your machine, open a terminal or command prompt and run the command: java -version.

If JDK 17 is not installed:

Windows

  • Download the installer from the official Oracle website.
  • Run the installer and follow the prompts.
  • Set the PATH environment variable: Search for 'Advanced System setting' in the windows search bar, click on 'Environment Variables'. Under 'System Variables', click on 'Path', then 'Edit', and then 'New'. Add the path of the bin directory of your JDK installation (e.g. C:\Program Files\Java\jdk-17\bin).
  • If this isn't working you can equally try the short name for program files
    • For "C:\Program Files", use "C:\PROGRA~1"
    • For "C:\Program Files (x86)", use "C:\PROGRA~2
  • The 'JAVA_PATH' variable also need to be set in 'System Variables'. Create or update the variable to the main jdk directory (e.g. C:\PROGRA~1\Java\jdk-17)

Mac OS/Linux

  • Download the tar.gz file from the official Oracle website.
  • Extract it to your desired location.
  • Add the bin directory of the extracted JDK to the PATH environment variable. Open your terminal and type: export PATH=$PATH:/path/to/your/jdk/bin

Maven

We're using Maven 3.9.3 for this project.

  • Download it from the official Apache website.
  • Extract it to your desired location.
  • Add the bin directory of the extracted Maven to the 'Path' system environment variable (e.g C:\PROGRA~1\apache-maven-3.9.3\bin).

GitHub

First, you'll need to fork our project. Then, you can integrate it into your preferred IDE. Here's a basic Git tutorial if you're new to Git.

The following commands are the basic workflow for contributing to the project:

  • git pull origin main: Get the latest version of the project.
  • git checkout -b <user_feature>: Create a new branch for your feature.
  • git add . and git commit -m "Your message": Commit your changes.
  • git push origin <user_feature>: Push your changes to GitHub.
  • Create a Pull Request on GitHub to merge your changes into the main project.

Visual Studio Code

  • Open the Command Palette (Ctrl+Shift+P) and choose Git: Clone.
  • Enter the URL of your forked repository.
  • Choose a location on your local machine to store the project.

Eclipse

  • Go to File > Import... > Git > Projects from Git > Clone URI.
  • Enter the URL of your forked repository and follow the prompts.

Note:

Both VScode and Eclipse have plugins to make it easy to use Git without memorizing git commands.

  • Github Pull Requests and Issues (VScode), but the default source control tab has everything I really need.
  • Egit (Eclipse)

Equally, the GitHub Desktop app makes using git very simple, but it is not linkable to Eclipse.

Develop and Test

Here are the basic Maven commands you'll need:

  • mvn compile: Use this to compile the project's source code.
  • mvn package: Use this to package the compiled code into its distributable format, such as a JAR.
  • mvn exec:java: Use this to run the project.
  • mvn exec:java -Dexec.mainClass="c6591.AnotherClass": Use this to test the main method of another class independently.
  • mvn clean: Use this to clean the build directory and remove all files generated by the previous build. This is typically done to ensure a fresh build of all artifacts.

Happy coding!