Skip to content

Installation

The Pine engine is distributed using GitHub Packages. The GitHub Packages docs contain more information about how it works.

This is the same as option 2, but with most of the work already done for you.

  1. Fork the Pine-boilerplate repository
  2. Follow the setup guide in the README file
  3. Change the package name to something that suits your project (Optional)
  1. In your build.gradle file, add the following lines:

    build.gradle
    repositories {
    mavenCentral()
    maven {
    url "https://repo.gradle.org/gradle/libs-releases"
    }
    maven {
    url = uri("https://maven.pkg.github.com/prozilla/pine")
    credentials {
    username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
    password = project.findProperty("gpr.token") ?: System.getenv("TOKEN")
    }
    }
    }
    dependencies {
    implementation "dev.prozilla:pine:3.0.1"
    }
  2. Create a gradle.properties file or a .env file with your environment variables. Replace YOUR_USERNAME and YOUR_TOKEN with your GitHub username and token respectively.

    gradle.properties
    gpr.user=YOUR_USERNAME
    gpr.token=YOUR_TOKEN

    Make sure to add this file to .gitignore so it remains private.

  1. In your pom.xml file, add the following lines:

    pom.xml
    <repositories>
    <repository>
    <id>gradle-releases</id>
    <url>https://repo.gradle.org/gradle/libs-releases</url>
    </repository>
    <repository>
    <id>pine-github</id>
    <url>https://maven.pkg.github.com/prozilla/pine</url>
    </repository>
    </repositories>
    <dependencies>
    <dependency>
    <groupId>dev.prozilla</groupId>
    <artifactId>pine</artifactId>
    <version>3.0.1</version>
    </dependency>
    </dependencies>
  2. Create a global settings.xml file in your Maven configuration folder (.m2) that stores your GitHub credentials. Replace YOUR_USERNAME and YOUR_TOKEN with your GitHub username and token respectively.

    .m2/settings.xml
    <settings>
    <servers>
    <server>
    <id>pine-github</id>
    <username>YOUR_USERNAME</username>
    <password>YOUR_TOKEN</password>
    </server>
    </servers>
    </settings>

It is possible to use Pine by downloading the JARs of Pine and its dependencies and adding them to the classpath. Sources and Javadoc JARs are also available.

This can also be used to install unreleased versions of Pine, like the development branch or a fork, by building Pine from source.

  1. Go to the Releases page and download the JAR of the version you want to use, or build Pine from source.

  2. Download the JARs of each dependency:

    • LWJGL
      • Core
      • GLFW
      • OpenGL
      • OpenAL
      • stb
      • Natives (Determined by the target platform)
    • Jackson
      • Core
      • Databind
      • Annotations

  3. Create a libs folder and move the JARs inside this folder

  4. Add all JARs to your classpath

When using a build system, it is possible to only download the Pine JAR manually and to import the other dependencies using said build system.

build.gradle
dependencies {
implementation files("libs/pine-engine-3.0.1.jar")
// LWJGL
// Use https://www.lwjgl.org/customize to install the required LWJGL packages
// Other Pine dependencies
implementation "com.fasterxml.jackson.core:jackson-databind:2.18.1"
implementation "org.gradle:gradle-tooling-api:8.8"
runtimeOnly "org.slf4j:slf4j-simple:2.0.16"
}

The following code can be used to quickly verify whether the installation of Pine was succesful or not. If no exception is thrown and a blank window opens, that means everything needed to run a Pine application is installed correctly.

public class Main {
public static void main(String[] args) {
new ApplicationBuilder().build().run();
}
}