- Go to AdoptOpenJDK and download Java JDK 14 MSI package.
- Download the .msi file. Open it to launch the installation program.
- Read and accept the license if you are happy with the terms.
- On the Custom Setup screen you can choose the features that you want to install and optionally change the default installation directory.
L2J Server on Windows 10
L2J is a complex piece of software engineering, it's divided in three main components, login server, game server and datapack.
Install OpenJDK
L2J is built using Java SE, to build you need Java JDK as well.
Install Git
L2J uses Git as version control system on BitBucket, use it to get the latest versions.
- Download and install Git from https://git-scm.com/download/win.
- During installation you may choose Notepad++ as default editor.
Install the Database Server
Download an install a database server and create a specific user.
- Download and install MariaDB from https://downloads.mariadb.org/
- Run MySQL Client (MariaDB (x64))
- Execute the following SQL statements to create a L2J specific database user:
CREATE OR REPLACE USER 'l2j'@'%' IDENTIFIED BY 'l2jserver2019';
GRANT ALL PRIVILEGES ON *.* TO 'l2j'@'%' IDENTIFIED BY 'l2jserver2019';
FLUSH PRIVILEGES;
Get the Source Code
Our official repositories are the ones listed bellow.
- Create a folder C:\opt\l2j\git and open cmd and run the following commands:
git clone https://bitbucket.org/l2jserver/l2j-server-login.git
git clone https://bitbucket.org/l2jserver/l2j-server-game.git
git clone https://bitbucket.org/l2jserver/l2j-server-datapack.git
Build the Server from Source Code
We use Maven to build the server files.
cd C:\opt\l2j\git\l2j-server-login
mvnw install
cd C:\opt\l2j\git\l2j-server-game
mvnw install
cd C:\opt\l2j\git\l2j-server-datapack
mvnw install
Deploy the Server
The deployment process at the moment is simply unzipping the built files.
- Create C:\opt\l2j\server\login
- Unzip C:\opt\l2j\git\l2j-server-login\target\l2jlogin.zip in C:\opt\l2j\server\login
- Create C:\opt\l2j\server\game
- Unzip C:\opt\l2j\git\l2j-server-game\target\l2j-server-game-2.6.2.0-SNAPSHOT.zip in C:\opt\l2j\server\game
- Unzip C:\opt\l2j\git\l2j-server-datapack\target\l2j-server-datapack-2.6.2.0-SNAPSHOT.zip in C:\opt\l2j\server\game
Get L2J CLI and Install the Database
L2J CLI is a tool developed by Zoey76 that allows us to implement automated deployments and initial configurations.
- Create C:\opt\l2j/cli
- Download L2J CLI
- Unzip the file in C:\opt\l2j\cli
- Run l2jcli.bat
db install -sql C:\opt\l2j\server\login\sql -u l2j -p l2jserver2019 -m FULL -t LOGIN -c -mods
db install -sql C:\opt\l2j\server\game\sql -u l2j -p l2jserver2019 -m FULL -t GAME -c -mods
quit
Create Administrator Account
Use the L2J CLI to create an administrator account, 8 is the maximum account level (master).
- Run l2jcli.bat
account create -u Zoey76 -p -a 8
quit
Start the Server
To start the server you need to run two scripts.
- Run C:\opt\l2j\server\login\startLoginServer.bat
- Run C:\opt\l2j\server\game\startGameServer.bat
Open Server Ports
If you are not playing from localhost you may need to open the some ports on your server.
- Follow the guide Tom's Hardware and open ports 2106 and 7777.
Connect to the Server
In order to connect to the server you have the following options:
HOSTS file
Edit C:\Windows\System32\drivers\etc\hosts and add this line:
127.0.0.1 l2authd.lineage2.com
BAT file
Create a .bat file with the following content:
@start l2.bin IP=127.0.0.1
Custom exe
Here is a C++ Win32 exe example:
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#define NOMINMAX
#include <windows.h>
#include <cstdlib>
// Start L2 as .bin with IP as parameter.
// You can use IP or DNS as IP parameter.
// You could include other parameters.
// You can change the path to the .bin file to avoid including the L2.exe inside the System folder.
// Author: Zoey76
int _stdcall wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd) {
ShellExecute(0, L"open", L"cmd.exe", L"/C start l2.bin IP=127.0.0.1", 0, SW_HIDE);
}
Download compiled version from here.
More information here.