Skip to content

Setting up development environment

Piotr Brzozowski edited this page Sep 7, 2020 · 5 revisions

Setting up JDK and tools

  • Install AdoptOpenJDK 12 (64 bit version)
  • Download JavaFX SDK and extract to JDK installation folder (usually C:\Program Files\AdoptOpenJDK\jdk-12.X.X.12-hotspot)
  • Download JavaFX jmods and extract to jmods folder (usually C:\Program Files\AdoptOpenJDK\jdk-12.X.X.12-hotspot\jmods)
  • Install Maven

Getting and building RuneChanger using Git Bash (or any bash shell on Windows)

git clone https://github.com/stirante/RuneChanger.git
cd RuneChanger
mvn clean package exec:java

After this, the folder with whole RuneChanger compiled should open, and the target folder should contain zip with RuneChanger, required libraries and JRE.

Running RuneChanger from IntelliJ IDEA

Press Alt + Shift + F10 and select Edit Configurations option.

Using plus button in top left corner, add Application configuration. Set following properties:

  • Main class: com.stirante.runechanger.RuneChanger
  • VM options: --add-exports=javafx.base/com.sun.javafx.event=org.controlsfx.controls
  • Additionally, you can enable debug mode, which sets debug log level and switches analytics to dev server by setting Program arguments to -debug-mode

Technical stuff about building RuneChanger

This is not a required knowledge, but I decided to share, because I'm really proud of this configuration.

Build phases

  • clean - this phase additionally cleans image/ directory
  • revision - adds information about a branch and commit to maven properties
  • resource - I added resource filtering, to fill version.json file and all scripts with useful information
  • jlink - creates JRE image with required modules and saves it to target/image/
  • single - assembly plugin creates zip file with JRE image, libraries, scripts and main jar
  • java - exec plugin runs class com.stirante.runechanger.util.AutoUpdater. This class unpacks zip created in a previous step to image folder, generates update definition and opens the folder in Explorer.