Paper Plugin Guide
File mode0

Tools

Compile Lab

Edit any example plugin in the browser and compile it against Paper 26.3 with real error messages.

BeginnerTool

Open any plugin from this guide, change it, and compile it against the real Paper 26.3 API, right here in your browser. You will learn to read compiler errors and fix them before you ever open IntelliJ.

What compiling means

The Java files you write are source code: text that people can read. A Minecraft server cannot run that text directly. First the compiler (a program called javac) reads every file, checks that the Java is correct and that every Paper class and method you use really exists, and turns your code into class files. Then all of the class files and your plugin.yml are packed into one jar file. That jar is your plugin: you drop it into a server's plugins folder.

This whole job is called compiling. IntelliJ and Gradle do exactly the same thing when you press Build Plugin Jar; the Compile Lab simply lets you do it without setting anything up.

From source file to a running plugin You write MyPlugin.java, javac turns it into MyPlugin.class files, Gradle packs them into a .jar, you put the jar in the server's plugins folder, and Paper loads it. You write MyPlugin.java source code javac the Java compiler checks and translates Compiled files MyPlugin.class code the JVM can run Gradle packs a jar the build tool ./gradlew build Plugin jar my-plugin-1.0.0.jar in build/libs Server folder plugins/ you copy the jar here Paper loads it on start Gradle runs javac for you, so you rarely call it by hand.
Your .java files go through the Java compiler, which checks them against the Paper API and makes class files. The class files and plugin.yml are packed into a jar that Paper loads.

The lab

Pick a project, click a file on the left to open it, and press Compile (or Ctrl+Enter). Your changes are saved in this browser, so you can leave and come back. Reset project always brings back the original code, so break things freely.

Loading the Compile Lab...

How to read a compiler error

When something is wrong, the compiler does not guess. It stops and prints a compiler error. Every error has the same four parts. Here is a real one, from a listener with a missing semicolon:

Build output
src/main/java/com/example/welcome/WelcomeListener.java:12: error: ';' expected        player.sendRichMessage("<green>Welcome to the server!")                                                               ^1 error
  1. The file: WelcomeListener.java, with its folder path in front.
  2. The line number: the number after the colon, 12. In the lab, click the problem and the editor jumps to that line and marks it in red.
  3. The message: what Java expected, here ';' expected.
  4. The arrow: the line of code again, with a ^ under the exact spot where Java got confused.

Some errors add two more lines. cannot find symbol tells you which name it did not know (symbol: class Player) and where you used it (location: class WelcomeListener):

Build output
src/main/java/com/example/welcome/WelcomeListener.java:11: error: cannot find symbol        Player player = event.getPlayer();        ^  symbol:   class Player  location: class WelcomeListener1 error

Here Java knows nothing called Player because the file is missing import org.bukkit.entity.Player; at the top.

The errors you will meet most

MessageWhat it usually meansHow to fix it
';' expectedA statement does not end with a semicolon.Add ; at the end of the line the arrow points at, or the line above it.
cannot find symbolA name is misspelled, has the wrong capital letters, or its class is not imported.Check the spelling against the guide's example and add the missing import.
package ... does not existAn import names a package that is not in Paper 26.3.Copy the import from a guide example; old tutorials often use names that moved.
incompatible typesA value has the wrong type, like text where a number is needed.Look at what the method expects; hover it in a guide example.
reached end of file while parsingA { was never closed.Add the missing }. The editor highlights the partner of the brace next to your cursor.
class X is public, should be declared in a file named X.javaThe class name and the file name do not match.Rename one so they match exactly, including capital letters.
method does not override or implement a method from a supertype@Override sits on a method with a misspelled name, like onEnabled.Use the exact name: onEnable, onDisable.

Every problem in the lab comes with a plain-English tip like these. For errors that happen while the server runs (not while compiling), use the Error Doctor.

Live mode and file mode

Compiling needs Java 25 on your PC, so it only works in live mode: open the guide by double-clicking Start Guide.cmd in the guide's folder. In file mode (when you open index.html directly) you can still read, edit and add files, and every example shows that it compiled on Paper 26.3 when the guide was built. Read Live mode and file mode for the details.

What to do with the jar

After a successful compile, Download gives you the plugin jar. You have two ways to try it:

  • Start a real Paper 26.3 server from the Test Server page and pick your jar from the list. It shows up there automatically.
  • Copy the jar into the plugins folder of your own server and restart it. Build and run shows the full workflow with IntelliJ.