# Compiling Plex

> How to compile Plex from source

Source: https://plex.us.org/docs/compiling/

Plex uses Gradle, so you do not manage dependencies by hand. If you do not want to build Plex yourself, you can download a pre-built JAR from the [CI server](https://ci.plex.us.org).

## Prerequisites

You need the following before you compile Plex.

Java 25 (JDK 25). Plex needs JDK 25 to compile. Earlier Java versions cause errors.

- If you do not have Java, download it from [Adoptium](https://adoptium.net/).
- During installation, add JDK 25 to your system PATH if the installer does not do this for you.

Git. You need Git to clone the repository and to build Plex.

- Windows users can download Git from [git-scm.com](https://git-scm.com).
- macOS and Linux users usually have Git already.

---

## Compile Plex

1. ### Download the source code

   Clone the Plex repository with Git.

   ```bash
   git clone https://github.com/plexusorg/Plex
   ```

2. ### Open the project directory

   ```bash
   cd Plex
   ```

3. ### Run the build

   Plex includes the Gradle wrapper, so you do not install Gradle. Run the command for your system.

   - macOS/Linux

     ```bash
     ./gradlew build
     ```

   - Windows

     ```bash
     gradlew.bat build
     ```

4. ### Find the compiled JARs

   Plex is a multi-module project. After a successful build, the JAR files are in the root `build/libs/` folder.

   ```
   build/libs/
   ```

   You get three files. The version in each file name matches the build.

   | File                          | Purpose                                                                                           |
   | ----------------------------- | ------------------------------------------------------------------------------------------------- |
   | `Plex-<version>.jar`          | The server plugin. Install this on your Paper server.                                             |
   | `Plex-Velocity-<version>.jar` | The Velocity proxy plugin. Install this only if you run a Velocity proxy.                         |
   | `Plex-API-<version>.jar`      | The module API library. Module authors compile against this. You do not install it on the server. |

## Run Plex

- Your server needs Java 25 to run Plex.
- Use a Vault-compatible permissions plugin for the best results.
- Plex needs a supported Minecraft version. See [Versions](/docs/versions) for the list.

Copy `Plex-<version>.jar` into the `plugins` folder of your Paper server. Start the server once so Plex writes its configuration files.

## Troubleshooting

### Permission denied on macOS or Linux

If you get a `Permission denied` error, make the Gradle wrapper executable.

```bash
chmod a+x gradlew
```

---

## Need help

If you need more help, join our [Discord server](https://discord.plex.us.org) and ask for support.
