These instructions are written with Linux in mind because that is my development environment.
Create a ".env" file, and assign the JAVA_HOME
variable to the path of the
Java 21 JDK. E.g.,
# Define the version of Java to use with Gradle (i.e., "./gradlew").
JAVA_HOME=/usr/lib/jvm/java-21-openjdk
The "env-gradlew" script is a wrapper around "gradlew", and loads the ".env" file to ensure Gradle is run with the proper version of Java.
Project files for IntelliJ IDEA and Eclipse can be generated by running the "idea" and "eclipse" tasks, respectively:
./env-gradlew idea
# OR
./env-gradlew eclipse
The Minecraft client can be run directly with the mod by running the "runClient" task:
./env-gradlew runClient
Once a world has been launched within Minecraft, the metrics can be inspected by running:
curl -Ss 'http://localhost:19565/metrics'
The release JAR can be compiled by running the "assemble" task:
./env-gradlew assemble
The release JAR will be located at "build/libs/Prometheus-Exporter-{MC Version}-forge-{Mod Version}.jar".