Wiki ArticlePages using DynamicPageList4Java EditionJava Edition technicalServer

server.jar

server.jar is an executable JAR file containing the program and resources of the Java Edition server software. It is distributed by Mojang Studios and can be downloaded free of charge.

The server.jar file can be opened with a file archiving program that supports ZIP files. It contains the program and default resources shared with the client.jar, but excluding client-specific code, like rendering and audio output, GUI, models, and others; both are identical in gameplay. It is intended to host a dedicated environment for multiplayer, being able to launch a headless[a] version of the game. The client.jar file also provides an internal server used for playing singleplayer worlds that can be opened into LAN.

The archive also contains a version.json file, which provides the game's version information, including the version ID (e.g., 26.2), data version, pack version, protocol version, and others.

This feature is exclusive to Java Edition.
 
server.jar

Server.jar GUI.png: Infobox image for Minecraft program 'server.jar'

Server.jar CLI.png: Infobox image for Minecraft program 'server.jar'

Author(s)
Platform(s) WindowsmacOSLinux and other platforms that support running a JVM
Written in Java Java
Latest version
Release date June 8, 2009
Size
  • Only JAR: ≈ 54 MiB
  • With initial generated data: ≈ 114 MiB
License EULA
Source available Partial
Links

Downloads

There is a related tutorial page for this topic!
 

server.jar is an executable JAR file containing the program and resources of the Java Edition server software. It is distributed by Mojang Studios and can be downloaded free of charge.

Contents

The server.jar file can be opened with a file archiving program that supports ZIP files. It contains the program and default resources shared with the client.jar, but excluding client-specific code, like rendering and audio output, GUI, models, and others; both are identical in gameplay. It is intended to host a dedicated environment for multiplayer, being able to launch a headless[a] version of the game. The client.jar file also provides an internal server used for playing singleplayer worlds that can be opened into LAN.

The archive also contains a version.json file, which provides the game's version information, including the version ID (e.g., 26.2), data version, pack version, protocol version, and others.

Generated server directory

Upon running the server.jar, libraries from the contained META-INF directory are extracted into the working directory. This behavior can further be configured by a different main class available on the JAR file, see § Bundler options.

The following contents are generated by default when no option is specified:

"*" marks a file that is not generated until the EULA (in eula.txt) is accepted.
  • File directory.png: Sprite image for directory in Minecraft working directory: The working directory of the server software process.
    • File directory.png: Sprite image for directory in Minecraft libraries: contains external libraries and JAR files required by the server software.
    • File archive.png: Sprite image for archive in Minecraft versions/<version>/server-<version>.jar: a versioned JAR file that directly contains the game's code and resources (similar to client.jar without client-related files).
    • File directory.png: Sprite image for directory in Minecraft logs: Contains logs.
      • File file.png: Sprite image for file in Minecraft YYYY-MM-DD-ordinal.log.gz: Rotated older log. There might be any number of these files depending on how many times the log was rotated. Same format as latest.log, but compressed with gzip.
      • File file.png: Sprite image for file in Minecraft latest.log: The most recent log. UTF-8 format with CRLF line endings on Windows or LF line endings on Linux and macOS.
    • File directory.png: Sprite image for directory in Minecraft world*: World data directory. The name can be specified in server.properties by level-name option.
    • File file.png: Sprite image for file in Minecraft banned-ips.json*: Specifies IP addresses that are banned from the server.
    • File file.png: Sprite image for file in Minecraft banned-players.json*: Specifies players that are banned from the server.
    • File file.png: Sprite image for file in Minecraft eula.txt: Contains information about the EULA applying to the server software, as well as specifying whether the user has accepted it.
    • File file.png: Sprite image for file in Minecraft ops.json*: Specifies operator status of players.
    • File file.png: Sprite image for file in Minecraft server-icon.png: Server icon in PNG file format with 64×64 pixels resolution, which appears for the client in their server list. Not generated automatically.
    • File archive.png: Sprite image for archive in Minecraft server.jar: The server software JAR file, used to setup the working directory, and starting up the server. It must be placed in the same directory as the rest of the server files.
    • File file.png: Sprite image for file in Minecraft server.properties: Preset configuration file used to configure most of the server's functionality.
    • File file.png: Sprite image for file in Minecraft whitelist.json*: Specifies players that are whitelisted.

Files are generated on the first run if not present in the same directory as server.jar.

eula.txt

If an eula.txt file does not exist on startup, it is generated with default content and the program exits. The default content is as follows:

#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms/MinecraftEULA).
#[Generation time]
eula=false

Much like server.properties, it follows the .properties syntax. eula has to be set to true for the server to start.

Interface

The server software has both a command-line interface and a basic graphical user interface.

The command-line interface outputs logs to the standard output, and accepts newline delimited input from the standard input, which is executed by the server as commands (similar to being executed by command blocks, but with the highest privilege level). Running a command in the interface does not require / at the beginning of the line.

The GUI appears if the platform supports windowing and the --nogui or nogui option is not provided. It is written in Abstract Window Toolkit (AWT) and features three sections:

  • "Stats" which displays memory usage (graph and number percentage) and average tick time,
  • "Players" which displays a player list, and
  • "Log and chat" which displays logs and serves the same function as the command-line interface.

Command-line options

Option Description
--bonusChest Enable the bonus chest when generating a world for the first time.
--demo Enable demo mode. Shows the players a demo pop-up, and players cannot break or place blocks after the 5 in-game days demo time has expired, even if they have purchased the game.
--eraseCache Erase cached data like light levels and biome data, which must then be regenerated. Equivalent to the "Erase Cached Data" option of "Optimize World" in World Options on the client.
--forceUpgrade Optimize the world by upgrading the level data to the latest format. Once the world is optimized, it is no longer compatible with older level formats. Equivalent to the "Optimize World" option in World Options on the client.
--help Print available options without starting the server.
--initSettings Initialize server.properties and eula.txt without starting the server. If either file is missing, it creates them with default values.
--jfrProfile Initialize Java Flight Recorder profiler for the server. While the server is running, the profiler can be opened using an external tool or software, such as VisualVM. It enables monitoring of the server's CPU, memory, and threads usage. Additionally, it saves a jfr file on the debug folder of the server.jar, containing JVM and operating system events, and several Minecraft-related custom events. Further information on Commands/jfr § Usage.
--nogui Disable the GUI when launching the server.
nogui Legacy alias of --nogui.
--pidFile <path> Create a text file at path containing the process identifier (PID) of the server process while it's running.
--port <port> Specify the TCP port to use instead of the value in server.properties.
--recreateRegionFiles Optimize the world similar to --forceUpgrade, but also rewrites all the chunks independently of whether they have been upgraded, creating fresh and defragmented region files.[1] Using this option after changing region-file-compression in server.properties will recompress all region files in the new format.
--safeMode Ensure the server only loads the vanilla data pack.
--serverId <id> Specify the "Server Id" string used in the crash report details.
--universe <path> Specify the path to the directory level-name in server.properties is relative to. If empty, it is relative to the working directory.
--world <name> Specify the world name to use instead of the level-name value in server.properties.

Bundler options

The server.jar introduces an extra layer of code (called the "bundler") for extracting runtime libraries. This allows the main class to be specified at startup using system properties.

The following system properties can change the startup behavior:[2]

  • bundlerMainClass: Specifies the main class to start. If not specified, the main class defined on META-INF/main-class file in the server.jar (usually net.minecraft.server.Main) is used instead. There are three available main classes:
    • net.minecraft.server.Main: Used for launching the Minecraft server.
    • net.minecraft.data.Main: Used as entry point for data generators[vg].
    • net.minecraft.gametest.Main: Used as an entry point for the GameTest framework, which provides its own command-line options.[3]
    • Unspecified: If no option is specified or an empty blank string ("") is entered, it results in Empty main class specified, exiting.
Before executing the main class, the JAR file automatically extracts libraries and versions folders, even for unspecified option.
  • bundlerRepoDir: Specifies the working directory for the resources extraction. If not specified, the current working directory is used instead.

System properties are specified like -D<property>, which property is the name defined above. They must be specified for the JVM program in the command-line, placed before -jar parameter (otherwise it will be specified for the server.jar file, which is invalid), e.g. java -DbundlerMainClass="net.minecraft.data.Main" -jar server.jar is a valid execution.

History

For general multiplayer server history, see Multiplayer § History.
Java Edition Classic
server 1.2The earliest archived version by the community (Omniarchive).
Server.properties options at this time include port, server-name, max-players, motd, public.
Java Edition Alpha
1.0.15server.jar was released to the public for Survival multiplayer server.
Java Edition
1.0.0Beta 1.9 Prerelease 4Added debug, enable-query, enable-rcon, query.port, rcon.password and rcon.port.
This marked the first introduction of Query and Remote console (RCON) protocols.
1.0.1server.jar was updated in a server-only release.
Fixed Invalid server key error when logging in.
Fixed Null pointer exception error when logging in.
1.3.112w18aThe server logic was separated from the client, making singleplayer effectively run an internal server.
Added command-line arguments: --demo, --port, --singleplayer, --universe, and --world. The legacy nogui argument remained functional.
12w19aAdded the --bonusChest command-line argument.
12w21aRemoved server.jar dependency in singleplayer.
1.1620w20bThe dedicated server main class was changed from net.minecraft.server.MinecraftServer to net.minecraft.server.Main.
20w22aAdded the --safeMode command-line argument.
1.1821w37aAdded the --jfrProfile command-line argument.
21w39aChanged the file structure of server.jar. Individual libraries are now bundled separately instead of being merged into a single archive.
Server startup now unpacks libraries into a directory configured by the bundlerRepoDir property (defaults to the working directory).
The main class can be changed using the bundlerMainClass property.
1.18-pre3Starting server.jar with an empty bundlerMainClass property now validates and extracts files, then exits.
1.2023w06aAdded the --pidFile command-line argument.
1.20.223w31aRemoved the --singleplayer command-line argument.
1.20.524w04aAdded the --recreateRegionFiles command-line argument.
Added the region-file-compression setting to server.properties.
1.21.424w45aThe data generator entry point (net.minecraft.data.Main) no longer generates the assets directory.
The --client command-line option was removed for the data generator entry point.
1.21.525w03aAdded the net.minecraft.gametest.Main entry point for running automated game tests from server.jar.
Added associated command-line arguments for the gametest entry point: --help, --packs, --report, --tests, --universe, and --verify.
1.21.925w35aAdded the Minecraft Server Management Protocol (MSMP).
25w37aMSMP clients must authenticate to access the API.
MSMP TLS is enabled by default.

Issues

Issues relating to "Server.jar", "Server jar", or "Java server" are maintained on the bug tracker. Issues should be reported and viewed there.

Notes

  1. On a headless environment without a graphical interface; if present, the server.jar will launch with a basic GUI by default, but can be disabled with --nogui option.

References

  1. "Minecraft Snapshot 24w04a" (§ Region file compression algorithm) by Java Team – Minecraft.net, January 24, 2024.
  2. "Minecraft Snapshot 21w39a" (§ Server bundling) by Adrian Östergård – Minecraft.net, September 29, 2021.
  3. "Minecraft Snapshot 25w03a" (§ Technical Changes) – Minecraft.net, January 15, 2025.

See also