Skip to content

Environment Setup

FlagCourier edited this page Oct 5, 2021 · 5 revisions

Setting up your environment for development

This page covers installing necessary software packages for building FlagWar from source, either for testing or development. While you can use self-compiled binaries in production, we highly caution against that practice.

This page also covers some additional tools to make development a little easier, but ultimately they are optional.

Contents

Minimum Requirements

The following software is required to clone and build FlagWar. An active internet connection is also required for grabbing build dependencies and fetching changes from version control.

See Aditional Tools for more recommendations.

* Java 16 is viable. Compilation testing against both Java 16 and Java 17 are performed when pushed to GitHub.

Using SDKMAN!

One tool to help manage development tools that we recommend using is SDKMAN!, a 3rd-party package manager. It runs on most Unix-like environments, such as Linux, FreeBSD, Solaris, and macOS. It even runs on Cygwin, and WSL2.

It can be used to manage both your Java and Maven installations, as well as several other development tools. See SDKMAN! Installation for installing it on your system.

For convenience's sake, the following shell commands should be all you need for a usable environment after SKDMAN!'s installation. You will still need to download git manually or through a traditional package manager.

# Show available Java distributions, and denote installed versions
sdk list java 

# Install a specific Java distribution (examples, may be out of date)
sdk install java               ## Installs the SDKMAN! selected default. (_Eclipse Temurin_)
sdk install java 17-open       ## Installs OpenJDK 17 from Java.net
sdk install java 17.0.0-oracle ## Installs Oracle's Java Standard Edition JDK

# You can install multiple java distributions. To switch to a specific one for your environment, use...
sdk java use [version]


# Installs Apache Maven
sdk install maven 3.8.1

Note! Do not use the alternatives maven profile if using any SDKMAN! retrieved distributions. It's not necessary, and can break the javadoc profile.

Traditional Package Managers

Don't want to use SDKMAN!? The traditional package managers work just as well.

Traditional package managers are great for grabbing things, and keeping them up-to-date (usually).

They are also somewhat of a newer concept for Windows, and macOS doesn't have a native package manager aside from the AppStore. (As far as I know, anyways.)

Linux Packages

  • Snapcraft (Snap Packages)

  • Arch

    • Use sudo pacman -S {package}, or build from the Arch User Repository (AUR)
    • Java: See the Arch Wiki Java page
    • Maven: maven
  • Debian (Sid), Ubuntu 20.04 / 21.04, or derivative of either

    • Use sudo apt install {package}
    • Java: openjdk-16-jdk or openjdk-16-headless
    • Maven: maven
  • Fedora, Fedora EPEL (RedHat, CentOS)

    • Use sudo dnf install {package}
    • Java: java-latest-openjdk-devel
    • maven: maven
  • OpenSUSE Tumbleweed

    • Use sudo zypper install {package}
    • Java: java-16-openjdk (Not available on OpenSUSE Leap 15.3)
    • maven: maven

Microsoft Windows

  • Windows Package Manager (winget) - Official package manager for Windows 10

    • Use winget install {package} (as administrator?)
    • Java: Microsoft.OpenJDK.16
    • Maven: N/A - Install manually or with Chocolatey
  • Chocolatey - An unofficial community-made package manager for Windows

    • Use choco install {package}
    • Java: openjdk, adoptopenjdk16, zulu16
    • maven: maven

Apple macOS

  • Homebrew - Unofficial community-made package manager for macOS and Linux.

Manual Setup

Sometimes, you can't find the package you were looking for. Or you may not have access to a package repository. In these cases, installing manually may be required. Please remember to consult the documentation when installing manually.

Apache Maven Installation

See the official Maven Installation Guide.

OpenJDK Installation

Due to the different vendors available, we recommend consulting vendor-specific documentation. Vendors may provide archives (.zip/.tar/etc), installer files, or both.

Additional Tools

The following tools are not strictly necessary, but they do provide good workflow improvements, or may help you spot mistakes early on.