Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Server.jar: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Remove broken links to missing pages
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
 
Line 1: Line 1:
{{Lowercase title}}
{{MC/Lowercase title}}
{{Exclusive|Java}}
{{MC/Exclusive|Java}}
{{Infobox program
{{Infobox program
| group1 = GUI
| group1 = GUI
Line 9: Line 9:
| author =
| author =
* [[File:Mojang Studios logo.svg|x20px|link=Mojang Studios]] Mojang Studios
* [[File:Mojang Studios logo.svg|x20px|link=Mojang Studios]] Mojang Studios
| platform = {{OS|win|mac|lin}} and other platforms that support running a JVM
| platform = {{MC/OS|win|mac|lin}} and other platforms that support running a JVM
| programming language = {{OS|java}} {{w|Java (programming language)|Java}}
| programming language = {{MC/OS|java}} {{MC/W|Java (programming language)|Java}}
| price = Free
| price = Free
| license = [https://www.minecraft.net/en-us/eula EULA]
| license = [https://www.minecraft.net/en-us/eula EULA]
Line 19: Line 19:
* With initial generated data: ≈ 114 MiB
* With initial generated data: ≈ 114 MiB
| version =
| version =
* '''Release''': {{v|java}}
* '''Release''': {{MC/V|java}}
{{#if: {{v|java-snap}} | * '''Snapshot''': {{v|java-snap}} }}
{{#if: {{MC/V|java-snap}} | * '''Snapshot''': {{MC/V|java-snap}} }}
| date = June 8, 2009
| date = June 8, 2009
| customlinks =
| customlinks =
'''Downloads'''
'''Downloads'''
* [https://piston-data.mojang.com/v1/objects/{{#dpl:title=Java Edition {{v|java|nolink=yes}}|includepage={Infobox version}:clienthash}}/server.jar Release {{v|java|nolink=yes}}]
* [https://piston-data.mojang.com/v1/objects/{{#dpl:title=Java Edition {{MC/V|java|nolink=yes}}|includepage={Infobox version}:clienthash}}/server.jar Release {{MC/V|java|nolink=yes}}]
* [https://piston-data.mojang.com/v1/objects/{{#dpl:title=Java Edition {{v|java-snap|nolink=yes}}|includepage={Infobox version}:clienthash}}/server.jar {{ucfirst:{{v|java-type|nolink=1}}}} {{v|java-snap|nolink=yes}}]
* [https://piston-data.mojang.com/v1/objects/{{#dpl:title=Java Edition {{MC/V|java-snap|nolink=yes}}|includepage={Infobox version}:clienthash}}/server.jar {{ucfirst:{{MC/V|java-type|nolink=1}}}} {{MC/V|java-snap|nolink=yes}}]
}}
}}
{{relevant tutorial|Setting up a Java Edition server}}
{{MC/Relevant tutorial|Setting up a Java Edition server}}
<code>'''server.jar'''</code> is an executable {{w|JAR (file format)|JAR}} file containing the program and resources of the {{JE}} server software. It is distributed by Mojang Studios and can be downloaded free of charge.
<code>'''server.jar'''</code> is an executable {{MC/W|JAR (file format)|JAR}} file containing the program and resources of the {{MC/JE}} server software. It is distributed by Mojang Studios and can be downloaded free of charge.


Code is shared between <code>server.jar</code> and <code>[[Minecraft:client.jar]]</code>, meaning they are identical in gameplay. The <code>client.jar</code> file provides an internal server used for playing singleplayer worlds, but <code>server.jar</code> does not provide a client.
Code is shared between <code>server.jar</code> and <code>[[Minecraft:client.jar]]</code>, meaning they are identical in gameplay. The <code>client.jar</code> file provides an internal server used for playing singleplayer worlds, but <code>server.jar</code> does not provide a client.
Line 34: Line 34:
== Contents ==
== Contents ==


The <code>server.jar</code> file can be opened with a {{w|file archiving program}} that supports ZIP files.
The <code>server.jar</code> file can be opened with a {{MC/W|file archiving program}} that supports ZIP files.


When ran, libraries from the contained <code>META-INF</code> directory are extracted into the working directory. This behavior can further be configured by a different main class available on the JAR file, see {{slink||Bundler options}}.
When ran, libraries from the contained <code>META-INF</code> directory are extracted into the working directory. This behavior can further be configured by a different main class available on the JAR file, see {{slink||Bundler options}}.
Line 74: Line 74:
</syntaxhighlight>
</syntaxhighlight>


Much like <code>server.properties</code>, it follows the {{w|.properties}} syntax. <code>eula</code> has to be set to <code>true</code> for the server to start.
Much like <code>server.properties</code>, it follows the {{MC/W|.properties}} syntax. <code>eula</code> has to be set to <code>true</code> for the server to start.


== Interface ==
== Interface ==


The server software has both a command-line interface and a basic {{w|graphical user interface}}.
The server software has both a command-line interface and a basic {{MC/W|graphical user interface}}.


The command-line interface outputs logs to the {{w|standard output}}, and accepts newline delimited input from the {{w|standard input}}, which is executed by the server as [[Minecraft:commands]] (similar to being executed by command blocks, but with the highest privilege level). Running a command in the interface does not require <code>/</code> at the beginning of the line.
The command-line interface outputs logs to the {{MC/W|standard output}}, and accepts newline delimited input from the {{MC/W|standard input}}, which is executed by the server as [[Minecraft:commands]] (similar to being executed by command blocks, but with the highest privilege level). Running a command in the interface does not require <code>/</code> at the beginning of the line.


The GUI appears if the platform supports windowing and the <code>--nogui</code> or <code>nogui</code> option is not provided. It is written in {{w|Abstract Window Toolkit}} (AWT), and it features three sections:
The GUI appears if the platform supports windowing and the <code>--nogui</code> or <code>nogui</code> option is not provided. It is written in {{MC/W|Abstract Window Toolkit}} (AWT), and it features three sections:
* "Stats" which displays memory usage as a graph and as a value, and average tick time,
* "Stats" which displays memory usage as a graph and as a value, and average tick time,
* "Players" which displays a player list, and
* "Players" which displays a player list, and
Line 105: Line 105:
| <code>'''--initSettings'''</code> || Initialize <code>[[Minecraft:server.properties]]</code> and <code>eula.txt</code> without starting the server. If either file is missing, it creates them with default values.
| <code>'''--initSettings'''</code> || Initialize <code>[[Minecraft:server.properties]]</code> and <code>eula.txt</code> without starting the server. If either file is missing, it creates them with default values.
|-
|-
| <code>'''--jfrProfile'''</code> || Initialize {{w|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 [https://visualvm.github.io/ VisualVM]. It enables monitoring of the server's CPU, memory, and threads usage. Additionally, it saves a <code>jfr</code> file on the <code>debug</code> folder of the <code>server.jar</code>, containing JVM and operating system events, and several ''Minecraft''-related custom events. Further information on {{slink|Commands/jfr|Usage}}.
| <code>'''--jfrProfile'''</code> || Initialize {{MC/W|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 [https://visualvm.github.io/ VisualVM]. It enables monitoring of the server's CPU, memory, and threads usage. Additionally, it saves a <code>jfr</code> file on the <code>debug</code> folder of the <code>server.jar</code>, containing JVM and operating system events, and several ''Minecraft''-related custom events. Further information on {{slink|Commands/jfr|Usage}}.
|-
|-
| <code>'''--nogui'''</code> || Disable the [[#Interface|GUI]] when launching the server.
| <code>'''--nogui'''</code> || Disable the [[#Interface|GUI]] when launching the server.
Line 111: Line 111:
| <code>'''nogui'''</code> || Legacy alias of <code>'''--nogui'''</code>.
| <code>'''nogui'''</code> || Legacy alias of <code>'''--nogui'''</code>.
|-
|-
| <code>'''--pidFile''' ''&lt;path&gt;''</code> || Create a text file at <code>''path''</code> containing the {{w|process identifier}} (PID) of the server process while it's running.
| <code>'''--pidFile''' ''&lt;path&gt;''</code> || Create a text file at <code>''path''</code> containing the {{MC/W|process identifier}} (PID) of the server process while it's running.
|-
|-
| <code>'''--port''' ''&lt;port&gt;''</code> || Specify the TCP port to use instead of the value in <code>server.properties</code>.
| <code>'''--port''' ''&lt;port&gt;''</code> || Specify the TCP port to use instead of the value in <code>server.properties</code>.
Line 135: Line 135:
** <code>net.minecraft.gametest.Main</code>: Used as an entry point for the [[Minecraft:GameTest]] framework, which provides its own command-line options.<ref>{{cite |url=https://www.minecraft.net/en-us/article/minecraft-snapshot-25w03a |title=Minecraft Snapshot 25w03a |section=Technical Changes |website=Minecraft.net |date=January 15, 2025}}</ref>
** <code>net.minecraft.gametest.Main</code>: Used as an entry point for the [[Minecraft:GameTest]] framework, which provides its own command-line options.<ref>{{cite |url=https://www.minecraft.net/en-us/article/minecraft-snapshot-25w03a |title=Minecraft Snapshot 25w03a |section=Technical Changes |website=Minecraft.net |date=January 15, 2025}}</ref>
** ''Unspecified'': If no option is specified or an empty blank string (<code>""</code>) is entered, it results in <code>Empty main class specified, exiting</code>.
** ''Unspecified'': If no option is specified or an empty blank string (<code>""</code>) is entered, it results in <code>Empty main class specified, exiting</code>.
: Before executing the main class, the JAR file automatically extracts {{cd|libraries}} and {{cd|versions}} folders, even for ''unspecified'' option.
: Before executing the main class, the JAR file automatically extracts {{MC/Cd|libraries}} and {{MC/Cd|versions}} folders, even for ''unspecified'' option.
* <code>bundlerRepoDir</code>: Specifies the working directory for the resources extraction. If not specified, the current working directory is used instead.
* <code>bundlerRepoDir</code>: Specifies the working directory for the resources extraction. If not specified, the current working directory is used instead.


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


== History ==
== History ==
{{For|general multiplayer server history|Multiplayer#History}}
{{MC/For|general multiplayer server history|Multiplayer#History}}
{{See also|Server.properties#History}}
{{MC/See also|Server.properties#History}}
{{HistoryTable
{{HistoryTable
|{{HistoryLine|java classic}}
|{{MC/HistoryLine|java classic}}
|{{HistoryLine||server 1.2|The earliest archived version.
|{{HistoryLine||server 1.2|The earliest archived version.
|[[Minecraft:Server.properties]] options at this time include {{cd|port}}, {{cd|server-name}}, {{cd|max-players}}, {{cd|motd}}, {{cd|public}}.}}
|[[Minecraft:Server.properties]] options at this time include {{MC/Cd|port}}, {{MC/Cd|server-name}}, {{MC/Cd|max-players}}, {{MC/Cd|motd}}, {{MC/Cd|public}}.}}
|{{HistoryLine|java alpha}}
|{{MC/HistoryLine|java alpha}}
|{{HistoryLine||1.0.15|<code>server.jar</code> was released to the public for Survival multiplayer server.}}
|{{MC/HistoryLine||1.0.15|<code>server.jar</code> was released to the public for Survival multiplayer server.}}
|{{HistoryLine|java edition}}
|{{MC/HistoryLine|java edition}}
|{{HistoryLine||1.0.0|dev=Beta 1.9 Prerelease 4|Added {{cd|debug}}, {{cd|enable-query}}, {{cd|enable-rcon}}, {{cd|query.port}}, {{cd|rcon.password}} and {{cd|rcon.port}}. This marked the first introduction of Query and Remote console (RCON) protocols.}}
|{{HistoryLine||1.0.0|dev=Beta 1.9 Prerelease 4|Added {{MC/Cd|debug}}, {{MC/Cd|enable-query}}, {{MC/Cd|enable-rcon}}, {{MC/Cd|query.port}}, {{MC/Cd|rcon.password}} and {{MC/Cd|rcon.port}}. This marked the first introduction of Query and Remote console (RCON) protocols.}}
|{{HistoryLine||1.0.1|<code>server.jar</code> was updated in a server-only release.
|{{MC/HistoryLine||1.0.1|<code>server.jar</code> was updated in a server-only release.
|Fixed <code>Invalid server key</code> error when logging in.
|Fixed <code>Invalid server key</code> error when logging in.
|Fixed <code>Null pointer exception</code> error when logging in.}}
|Fixed <code>Null pointer exception</code> error when logging in.}}
|{{HistoryLine||1.3.1|dev=12w18a|The server logic was separated from the client, making singleplayer effectively run an internal server.
|{{MC/HistoryLine||1.3.1|dev=12w18a|The server logic was separated from the client, making singleplayer effectively run an internal server.
|Added command-line arguments: <code>--demo</code>, <code>--port</code>, <code>--singleplayer</code>, <code>--universe</code>, and <code>--world</code>. The legacy <code>nogui</code> argument remained functional.}}
|Added command-line arguments: <code>--demo</code>, <code>--port</code>, <code>--singleplayer</code>, <code>--universe</code>, and <code>--world</code>. The legacy <code>nogui</code> argument remained functional.}}
|{{HistoryLine|||dev=12w19a|Added the <code>--bonusChest</code> command-line argument.}}
|{{MC/HistoryLine|||dev=12w19a|Added the <code>--bonusChest</code> command-line argument.}}
|{{HistoryLine|||dev=12w21a|Removed <code>server.jar</code> dependency in singleplayer.}}
|{{MC/HistoryLine|||dev=12w21a|Removed <code>server.jar</code> dependency in singleplayer.}}
|{{HistoryLine||1.16|dev=20w20b|The dedicated server main class was changed from <code>net.minecraft.server.MinecraftServer</code> to <code>net.minecraft.server.Main</code>.}}
|{{MC/HistoryLine||1.16|dev=20w20b|The dedicated server main class was changed from <code>net.minecraft.server.MinecraftServer</code> to <code>net.minecraft.server.Main</code>.}}
|{{HistoryLine|||dev=20w22a|Added the <code>--safeMode</code> command-line argument.}}
|{{MC/HistoryLine|||dev=20w22a|Added the <code>--safeMode</code> command-line argument.}}
|{{HistoryLine||1.18|dev=21w37a|Added the <code>--jfrProfile</code> command-line argument.}}
|{{MC/HistoryLine||1.18|dev=21w37a|Added the <code>--jfrProfile</code> command-line argument.}}
|{{HistoryLine|||dev=21w39a|Changed the file structure of <code>server.jar</code>. Individual libraries are now bundled separately instead of being merged into a single archive.
|{{MC/HistoryLine|||dev=21w39a|Changed the file structure of <code>server.jar</code>. 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 <code>bundlerRepoDir</code> property (defaults to the working directory).
|Server startup now unpacks libraries into a directory configured by the <code>bundlerRepoDir</code> property (defaults to the working directory).
|The main class can be changed using the <code>bundlerMainClass</code> property.}}
|The main class can be changed using the <code>bundlerMainClass</code> property.}}
|{{HistoryLine|||dev=1.18-pre3|Starting <code>server.jar</code> with an empty <code>bundlerMainClass</code> property now validates and extracts files, then exits.}}
|{{MC/HistoryLine|||dev=1.18-pre3|Starting <code>server.jar</code> with an empty <code>bundlerMainClass</code> property now validates and extracts files, then exits.}}
|{{HistoryLine||1.20|dev=23w06a|Added the <code>--pidFile</code> command-line argument.}}
|{{MC/HistoryLine||1.20|dev=23w06a|Added the <code>--pidFile</code> command-line argument.}}
|{{HistoryLine||1.20.2|dev=23w31a|Removed the <code>--singleplayer</code> command-line argument.}}
|{{MC/HistoryLine||1.20.2|dev=23w31a|Removed the <code>--singleplayer</code> command-line argument.}}
|{{HistoryLine||1.20.5|dev=24w04a|Added the <code>--recreateRegionFiles</code> command-line argument.
|{{MC/HistoryLine||1.20.5|dev=24w04a|Added the <code>--recreateRegionFiles</code> command-line argument.
|Added the <code>region-file-compression</code> setting to [[Minecraft:server.properties]].}}
|Added the <code>region-file-compression</code> setting to [[Minecraft:server.properties]].}}
|{{HistoryLine||1.21.4|dev=24w45a|The data generator entry point (<code>net.minecraft.data.Main</code>) no longer generates the assets directory.
|{{MC/HistoryLine||1.21.4|dev=24w45a|The data generator entry point (<code>net.minecraft.data.Main</code>) no longer generates the assets directory.
|The <code>--client</code> command-line option was removed for the data generator entry point.}}
|The <code>--client</code> command-line option was removed for the data generator entry point.}}
|{{HistoryLine||1.21.5|dev=25w03a|Added the <code>net.minecraft.gametest.Main</code> entry point for running automated game tests from <code>server.jar</code>.
|{{MC/HistoryLine||1.21.5|dev=25w03a|Added the <code>net.minecraft.gametest.Main</code> entry point for running automated game tests from <code>server.jar</code>.
|Added associated command-line arguments for the gametest entry point: <code>--help</code>, <code>--packs</code>, <code>--report</code>, <code>--tests</code>, <code>--universe</code>, and <code>--verify</code>.}}
|Added associated command-line arguments for the gametest entry point: <code>--help</code>, <code>--packs</code>, <code>--report</code>, <code>--tests</code>, <code>--universe</code>, and <code>--verify</code>.}}
|{{HistoryLine||1.21.9|dev=25w35a|Added the Minecraft Server Management Protocol (MSMP).}}
|{{MC/HistoryLine||1.21.9|dev=25w35a|Added the Minecraft Server Management Protocol (MSMP).}}
|{{HistoryLine|||dev=25w37a|MSMP clients must authenticate to access the API.|MSMP TLS is enabled by default.}}
|{{MC/HistoryLine|||dev=25w37a|MSMP clients must authenticate to access the API.|MSMP TLS is enabled by default.}}
}}
}}


== Issues ==
== Issues ==
{{Issue list|server.jar|server jar|java server|projects=mc}}
{{MC/Issue list|server.jar|server jar|java server|projects=mc}}


== References ==
== References ==
Line 184: Line 184:


== See also ==
== See also ==
* [[Minecraft:Bedrock Dedicated Server]], the server software used to host a {{BE}} server.
* [[Minecraft:Bedrock Dedicated Server]], the server software used to host a {{MC/BE}} server.
* [[Minecraft:client.jar]], the program and resources for the '' Java Edition'' game.
* [[Minecraft:client.jar]], the program and resources for the '' Java Edition'' game.


== Navigation ==
== Navigation ==
{{Navbox Java Edition technical|general}}
{{MC/Navbox Java Edition technical|general}}


[[Category:Server]]
[[Category:Server]]

Latest revision as of 20:55, 9 April 2026

Script error: No such module "Exclusive". Template:Infobox program Template:Pointer box server.jar is an executable

  1. REDIRECT Template:Wikipedia

Template:Redr 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.

Code is shared between server.jar and Minecraft:client.jar, meaning they are identical in gameplay. The client.jar file provides an internal server used for playing singleplayer worlds, but server.jar does not provide a client.

Contents

The server.jar file can be opened with a

  1. REDIRECT Template:Wikipedia

Template:Redr that supports ZIP files.

When ran, 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 Template:Slink.

The archive also contains a version.json file, which provides version information.

Directory structure

Upon running the server.jar, the program generates the following files and directories:

  • Template:File: The working directory of the server software process.
    • Template:File: contains external libraries and JAR files required by the server software.
    • Template:File: a versioned JAR file that contains the primary code and resources for the server (similar to Minecraft:client.jar, but without client-related files, e.g. rendering code).
    • Template:File: Contains logs.
      • Template:File: 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.
      • Template:File: The most recent log. UTF-8 format, CRLF line endings on Windows, LF line endings on Linux and macOS.
    • Template:File: World data directory. Can have different name or location if the default value in server.properties is changed. Not generated until the EULA is accepted.
    • Template:File: Specifies IP addresses that are banned from the server. Not generated until the EULA is accepted.
    • Template:File: Specifies players that are banned from the server. Not generated until the EULA is accepted.
    • Template:File: Contains information about the EULA applying to the server software, as well as specifying whether the user has accepted it.
    • Template:File: Specifies operator status of players. Not generated until the EULA is accepted.
    • Template:File: Server icon that appears on the server list. Not generated automatically. Must be in PNG format and 64x64 pixels.
    • Template:File: Primary server software JAR file. Can be located elsewhere, but usually placed in the same directory as the rest of the server data.
    • Template:File: Preset configuration file used to configure most of the server's functionality.
    • Template:File: Specifies players that are whitelisted. Not generated until the EULA is accepted.

Files are generated on the first run if not mentioned otherwise.

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:

<syntaxhighlight lang="properties">

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

eula=false </syntaxhighlight>

Much like server.properties, it follows the

  1. REDIRECT Template:Wikipedia

Template:Redr 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

  1. REDIRECT Template:Wikipedia

Template:Redr.

The command-line interface outputs logs to the

  1. REDIRECT Template:Wikipedia

Template:Redr, and accepts newline delimited input from the

  1. REDIRECT Template:Wikipedia

Template:Redr, which is executed by the server as Minecraft: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

  1. REDIRECT Template:Wikipedia

Template:Redr (AWT), and it features three sections:

  • "Stats" which displays memory usage as a graph and as a value, 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

<section begin="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 Minecraft:server.properties and eula.txt without starting the server. If either file is missing, it creates them with default values.
--jfrProfile Initialize
  1. REDIRECT Template:Wikipedia

Template:Redr 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 Template:Slink.

--nogui Disable the GUI when launching the server.
nogui Legacy alias of --nogui.
--pidFile <path> Create a text file at path containing the
  1. REDIRECT Template:Wikipedia

Template:Redr (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.<ref>Template:Cite</ref> 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.

<section end="command-line-options"/>

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:<ref>Template:Cite</ref>

  • 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 Template:Tpl.
    • net.minecraft.gametest.Main: Used as an entry point for the Minecraft:GameTest framework, which provides its own command-line options.<ref>Template:Cite</ref>
    • 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
  1. REDIRECT Template:Code

Template:Redr and

  1. REDIRECT Template:Code

Template:Redr 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

Template:Hatnote {{#vardefine:params|0 }}Template:Hatnote Template:HistoryTable

Issues

Script error: No such module "Issue list".

References

<references/>

See also

Navigation

Concepts
General format
World
Legacy
Level format
Legacy
.minecraft
Tools
Sound
Commands

All commands

Launching
Legacy
Protocol
Server
Protocols
Legacy
Components
Tag
GameTest
World generation
Noise settings
Structures
Removed
Data packs
Tutorials
Content
World generation

Template:Article other

de:server.jar fr:server.jar ja:Server.jar pt:Server.jar zh:服务端核心文件