L2J Java Setup: JDK, Eclipse and XAMPP Without the Guesswork

A working l2j java setup is less about installing three programs and more about installing them in the right order and the right versions. Most failed first builds come from a JDK newer or older than the pack expects, a JAVA_HOME that points at a different install, or a database that is already using the port XAMPP wants. This guide walks the toolchain in the order that avoids those traps: JDK first, database second, IDE third, and XAMPP only where it earns its place.
The Order That Saves Time
Install the JDK, verify it from a terminal, then install the database, then open the project in Eclipse. Doing the IDE first feels productive, but Eclipse will happily bind to the wrong runtime and send you chasing compiler errors that are really environment errors.
- Choose the JDK version your server pack targets.
- Install it and set
JAVA_HOME. - Install MariaDB or MySQL and create the database user.
- Import the pack in Eclipse and run a build with no code changes.
- Only then start editing configuration and code.

Pick the JDK Your Pack Targets
There is no single correct Java version for Lineage 2 servers. Each pack declares its own target, and installing the newest release because it is newest is the fastest way to a build that fails on day one.
| Pack family | Typical target | Notes |
|---|---|---|
| Official L2J Server | Java 25 (Temurin) | Tracks the current long-term-support JDK |
| L2J Mobius | Java 17 or newer | Check the branch README, older branches moved from Java 8 |
| aCis | Java 21 | Older revisions expect an older JDK |
Open the pack README first and search for the Java version. If the README is silent, check the build file or the Maven compiler settings. A two-minute check prevents an afternoon of "Unsupported class file major version" errors.
For the runtime itself, use an OpenJDK build such as Eclipse Temurin. It is free, well documented and available for Windows, Linux and macOS. The official L2J installation guide uses the same distribution.
Install the JDK and Set JAVA_HOME
On Windows, winget installs and registers the JDK in one step. On Linux, use your distribution's package manager or the Adoptium repository. Either way, the important part is the environment variable.
- Windows: set
JAVA_HOMEto the JDK folder, not thebinsubfolder, then add%JAVA_HOME%\bintoPATH. - Linux: export
JAVA_HOMEin your shell profile and put$JAVA_HOME/binfirst inPATH. - Multiple versions: keep them installed and switch deliberately. On Linux,
update-alternativeshandles the command-line tools.
Verify both commands, not just one: java --version and javac --version. If they disagree, your PATH is mixing a JRE with a JDK, and the build will fail later in a confusing way.

Eclipse: Import and Compile
Use Eclipse IDE for Java Developers. For a Maven-based L2J pack, import as an existing Maven project and let it resolve dependencies. For an Ant-based pack, import the project and confirm the build file is detected.
- Set the installed JRE to the same JDK your pack targets, not the newest one on the machine.
- Set the compiler compliance level to match that JDK.
- Set text encoding to UTF-8 before you edit a single file.
- Run a clean build before changing code, so you know the starting point is healthy.
If the project shows "JRE System Library unbound", Eclipse is pointing at a runtime that was removed or renamed. Fix the installed JRE list and rebuild. Do not add jars by hand to silence the error.
XAMPP: Useful, but Not Required
XAMPP bundles Apache, PHP, MariaDB and phpMyAdmin in one installer. For an L2 server, only the database part matters, and many packs run perfectly with a standalone MariaDB install. XAMPP is convenient when you want phpMyAdmin without configuring anything, and it is a common choice for a first local test.
It also brings two traps:
- Port conflict: if MariaDB or MySQL is already installed as a service, XAMPP cannot bind port 3306. Stop one of them before starting the other.
- Development defaults: root can end up without a password, and the bundled engine may listen beyond localhost. Set a root password and bind it to localhost even on a desktop.
Use XAMPP for local development if you like the panel, but set a root password and bind it to localhost. For production, install MariaDB as a service, create a dedicated user, and keep the port closed to the internet. The database side is covered in more depth in the database setup guide, and a pack-specific build is covered in the aCis pack setup guide.
A Database Client You Can Trust
phpMyAdmin is fine for a quick look, but a desktop client is faster for loading schemas and checking tables. HeidiSQL on Windows and DBeaver on any platform both connect to MariaDB and MySQL, show table structure clearly and handle large SQL files without timing out in a browser tab.
Test the connection with the same credentials the game server will use, not with root. If the dedicated user cannot connect from the client, the server will not connect either.
Version Errors and What They Mean
Java version errors are usually explicit once you know how to read them. A class file compiled for a newer JDK cannot run on an older one, and the major version number tells you which release produced it.
| Major version | Java release |
|---|---|
| 52 | Java 8 |
| 55 | Java 11 |
| 61 | Java 17 |
| 65 | Java 21 |
| 69 | Java 25 |
- "Unsupported class file major version": the runtime is older than the compiler. Install the matching JDK or rebuild with the right target.
- "JAVA_HOME is not set": the variable is missing or points at the wrong folder. Set it to the JDK root, then put
%JAVA_HOME%inin PATH. - "Could not open jvm.cfg": a stale
java.exefrom an older install is resolved first, usually a leftover PATH entry or a 32-bit and 64-bit mix. Remove it. - "Port 3306 in use": two database engines are fighting for the same port. Stop the one you are not using.
Checklist Before Your First Build
Run through this once and most first-build problems disappear:
java --versionandjavac --versionreturn the same major version.JAVA_HOMEpoints at the JDK root and itsbinfolder is first in PATH.- The database service is running and the dedicated user can log in.
- Eclipse uses the same JDK and UTF-8 encoding.
- A clean build succeeds before you change any code.
The toolchain is boring by design. Get it right once, document the versions in your project notes, and you will not repeat the setup on the next machine.
When the server is ready to meet players, add it through the free listing form. If you want the listing to stand out, VIP placement puts it ahead of the queue in the server directory.
