-2

I've been trying to start a Minecraft server. I read a small guide and followed the steps, until I tried to run this code:

java -Xmx1G -Xms200M -jar minecraft_server.exe nogui
pause

I keep getting the Windows script reader error code "800A0401", accompanied with the message "Expected end of statement". What does this mean and how do I fix it?

Joachim
  • 20,337
  • 15
  • 73
  • 103

2 Answers2

1

The guide you linked is wrong in two ways.

  1. It suggests, that the server is distributed in an exe file format, while it is usually a file named server.jar
  2. It saves the start script with the vbs extension instead of bat.

The correct way

  1. Obtain the server executable from the official site.
    Note: This guide assumes, that the downloaded file is called server.jar. If not, you should rename it.

  2. Type the following text into a notepad, and save it as start.bat in the same folder as your server executable jar-file.
    Note: You can change the amount of memory allocated to your server by changing the values after Xmx and Xms. Xmx sets the maximum amount of used RAM, Xms sets the amount of RAM allocated on start. It is recommended for the two to have the same value, but it isn't required. Append M to the value to indicate megabytes, or G to indicate gigabytes.

java -Xmx1024M -Xms1024M -jar server.jar nogui
pause
  1. (After this you can follow the original guide.)
    Run the start.bat file, and you'll get an eula.txt file. Open it, and change the last false to true. Save and run the file again.

  2. Now the server files should've generated, and the basic setup should be done. You might want to change some settings in the server.properties file.

Andruida
  • 266
  • 1
  • 6
0

The command should look like this:

java -Xmx1024M -Xms1024M -jar minecraft_server.1.15.2.jar nogui
pause

Yours didn't look like this, specifically this part:

-Xmx1024M -Xms1024M

There are a few other possible reasons why this didn't work. One obvious one is that you didn't install Java. Another one would be that you might have not set the EULA to 'true'. The last one I can think of is you don't have the .JAR extension showing up. If it doesn't, in File Explorer, at the top tabs, click on View. Then, check "File name extensions". If you don't understand, see the image below:

View > File name Extensions

galacticninja
  • 46,036
  • 98
  • 303
  • 557
nishantc1527
  • 818
  • 2
  • 8
  • 16