scripts lineage2  :::  Server Packs lineage 2 — best scripts for admin servers   :::  Projects lineage Turnkey
l2-scripts.com  Freelance Studio

ArticlesTechnical guides8 min read

Working with L2 Server Pack Sources in IntelliJ IDEA or Eclipse and Git

How to open a Lineage 2 Java server pack in a modern IDE, set up the JDK, build the project and track your changes in Git: cloning, branches, commits and syncing.

Old guides told you to install Eclipse Classic with the Subclipse and m2eclipse plugins and keep the code in SVN. Today everything you need is built into modern IDEs, and Git is the standard for version control. Below is an up-to-date workflow for L2J-family server packs and their derivatives.

What you need

ComponentWhat to installPurpose
JDK17 or 21 (LTS), 64-bit; check your pack's requirements for the exact versioncompiling and running the server
IDEIntelliJ IDEA Community or Eclipse IDE for Java Developersediting, code navigation, building, debugging
Gitcurrent versionchange history, branches, sharing code with your team
Build toolMaven, ANT or Gradle; usually already built into the IDEbuilding the server jar/zip
Which Java version does the pack need?Check the sources: in pom.xml look for maven.compiler.release (or source/target), in build.xml for the release, source and target attributes of the javac task, in build.gradle for the toolchain or sourceCompatibility. Current packs need Java 17 or 21. Very old chronicles may only build on Java 8; in that case install the version the project requires.

What a pack usually consists of

The sources of an L2J-style pack are either one repository with several modules or several separate repositories:

  • login (loginserver, authserver): the authentication server;
  • gameserver: the game server core;
  • datapack: XML/HTML data, scripts and SQL tables;
  • shared modules (commons) and a lib/ folder with third-party libraries;
  • build files: pom.xml (Maven), build.xml (ANT) or build.gradle (Gradle).

Step 1. Install the JDK, an IDE and Git

  1. Install JDK 17 or 21 (64-bit) and check it in a new terminal window: java -version and javac -version. Setting JAVA_HOME is covered in the Windows setup guide.
  2. Install IntelliJ IDEA Community or Eclipse IDE for Java Developers. Both already support Git, Maven, Gradle and ANT, so you no longer need to install separate plugins.
  3. Install Git and set your name and e-mail once; they are recorded in every commit:
git config --global user.name "Your Name"
git config --global user.email you@example.com
git config --global init.defaultBranch main
Line endingsPacks contain both .bat scripts for Windows and .sh scripts for Linux. To keep .sh files from breaking because of CRLF line endings (the /bin/bash^M: bad interpreter error), add a .gitattributes file to the repository root:
* text=auto
*.sh  text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.jar binary
*.zip binary

Step 2. Get the sources with git clone

The pack developer gives you the repository address (HTTPS or SSH). Clone it into a working folder, preferably one whose path has no spaces or non-Latin characters:

cd D:\work
git clone REPOSITORY_URL l2-server
cd l2-server
git status

For a private repository an SSH key is the most convenient option: create one with the command below and add the contents of the .pub file to your account settings on the Git server. Your account password usually does not work for Git operations, so use a key or an access token.

ssh-keygen -t ed25519 -C "you@example.com"
cat ~/.ssh/id_ed25519.pub

You can also clone straight from the IDE: in IntelliJ IDEA use File > New > Project from Version Control, in Eclipse File > Import > Git > Projects from Git.

Step 3. Open the project in IntelliJ IDEA

  1. File > Open and select the project root (the folder with pom.xml, build.gradle or build.xml). Maven and Gradle projects are imported automatically: wait until the IDE downloads the dependencies and indexes the code (progress bar at the bottom).
  2. File > Project Structure > Project: set SDK to JDK 17/21 (if it is not listed, use Add SDK > JDK and point to the JDK folder) and the Language level the pack requires.
  3. Settings > Editor > File Encodings: set Project Encoding to UTF-8 or to the encoding the sources are actually written in (old packs sometimes use windows-1251). A wrong encoding is what turns Russian strings into garbage.
  4. For a project that only has build.xml, mark the source folder as Sources (Project Structure > Modules) and add the jars from lib/ as a library (Libraries > + > Java). Add build.xml itself to the Ant tool window with the + button.
  5. Check that it compiles: Build > Build Project (Ctrl+F9). If a Maven project is full of red, click Reload All Maven Projects in the Maven tool window.

Step 3, alternative. Eclipse IDE for Java Developers

  1. Import a Maven project via File > Import > Maven > Existing Maven Projects, a Gradle project via File > Import > Gradle > Existing Gradle Project, anything else via File > Import > Git > Projects from Git.
  2. Window > Preferences > Java > Installed JREs > Add > Standard VM: point to the JDK folder (not a JRE) and tick it. Under Java > Compiler set the required Compiler compliance level.
  3. Window > Preferences > General > Workspace: set Text file encoding to the encoding of the sources.
  4. Do not ignore pom.xml errors after the import: right-click the project > Maven > Update Project (Alt+F5) with Force Update ticked usually fixes them.
  5. ANT builds: right-click build.xml > Run As > Ant Build... and pick the target you need.

Step 4. Build and run from the IDE

Building is covered in detail in separate guides: Maven and ANT (build.xml). In short:

  • Maven: Maven tool window > Lifecycle > clean, then package; the output goes to target/.
  • Gradle: Gradle tool window > Tasks > build > build; the output goes to build/libs/ or build/distributions/.
  • ANT: Ant tool window > the dist target (or whatever the main target is called); the output usually goes to build/.

To run and debug the server from the IDE, create an Application run configuration: the server's main class (for example, your pack's GameServer class), the working directory set to the built server folder that contains config/, and memory settings in VM options (-Xms, -Xmx). With a wrong working directory the server will not find its configs.

A server running on another machine can be debugged remotely: add the option below to its startup script and connect from the IDE with a Remote JVM Debug configuration on port 5005.

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
SecurityThe debug port gives full control over the server process. Never expose it to the internet; use it only locally, over a VPN or through an SSH tunnel.

Step 5. Everyday Git

CommandWhat it does
git statusshows changed and new files
git pullfetches and merges changes from the remote repository
git switch -c fix/olympiadcreates a branch and switches to it
git add file, git add -Astages changes for a commit
git commit -m "message"records the staged changes with a message
git push -u origin fix/olympiadsends the branch to the server
git log --onelinecompact commit history
git diffshows changes that are not committed yet
git stashtemporarily shelves uncommitted changes

A typical cycle is one branch per task:

git switch main
git pull
git switch -c fix/olympiad-points
# edit the code, build, test on a test server
git add -A
git commit -m "Olympiad: fix points calculation"
git push -u origin fix/olympiad-points
# then merge the branch into main (merge request or git merge)

The main branch may be called main or master; git branch -a lists all branches. The same actions are available in the IDE: in IntelliJ IDEA use Commit (Ctrl+K), Update Project (Ctrl+T) and Push (Ctrl+Shift+K); in Eclipse use the Team menu and the Git Staging view.

Updating the right wayDo not update the project with a replace-with-repository-version command: it wipes your changes. Commit your work first, then run git pull. If Git reports a conflict, open the conflicting files in the IDE (Git > Resolve Conflicts in IntelliJ IDEA), choose the right lines and finish the merge with a commit.

What to keep out of the repository: .gitignore

Build output, IDE settings, logs and passwords do not belong in the repository. Create a .gitignore file in the project root:

# Build output
target/
build/
out/
*.class

# IDE files
.idea/
*.iml
.classpath
.project
.settings/

# Server logs and runtime files
log/
logs/
*.log
Check the build foldersIn some packs the build/, dist/ or bin/ folder is part of the sources (it holds configs and startup scripts). Ignore only what the build generates. If build output has already been committed, remove it from the index with git rm -r --cached target and commit.

Never commit real database passwords or keys: keep a sample config in the repository and the working file with passwords only on the server.

If the project is still in SVN

SVN (Subversion) used to be the standard for L2 packs, and some old projects still live there. The basic commands are svn checkout to get a working copy, svn update to update it and svn commit to send changes. It is easier to move the history to Git once; for the standard trunk/branches/tags layout:

git svn clone SVN_URL --stdlayout l2-server

Common problems

ProblemSolution
All code is red, Cannot resolve symbolno JDK selected or dependencies not loaded: Project Structure > SDK, then Reload in the Maven or Gradle tool window
release version 21 not supportedthe IDE or build tool runs on an older JDK: select JDK 21 in the project and Maven/Gradle/Ant settings
Garbage instead of Russian textwrong file encoding in the IDE settings or in pom.xml/build.xml
Permission denied (publickey) on clone or pushthe SSH key is not added to your account or Git is using a different key
Conflict on git pullresolve the conflict in the IDE, then git add and git commit
/bin/bash^M: bad interpreter on Linuxthe script has CRLF line endings: set up .gitattributes and resave the file with LF endings

Looking for a pack with source code or help setting up your environment? See our server packs and turnkey projects. More material is in the articles list.

Published 30 October 2026

Read also

Need help with your server?

We help with the server pack, setup, protection and launch — one-off or on an ongoing basis.

L2‑Scripts newsletter

Get L2‑Scripts news by email

And 5% off all studio services while you stay subscribed.

The discount is valid while you are subscribed: when ordering, tell the manager your subscription address on Telegram.