Start.bat not working

Here’s my start.bat

@echo off
java -Xms1G -Xmx1G -XX:+UseG1GC -jar paper-1.16.4-355.jar nogui

PAUSE

It’s saved as “start.bat” in the same directory as my paper.jar file. When run, it briefly opens a cmd window, then closes it right after. I got this code from the spigot wiki. Is the code wrong, or is something in the batch file missing?

@tenderpork is your paper jar name the same one as in the java command?

yes.

i copied directly from the jar name and pasted it into the batch file.

i have no idea why the batch file isnt running correctly. i got it directly from the spigot wiki.

EDIT: I removed the “@echo off” and it ran the server. however, even tho i specified “nogui”, the server still gave me both the gui and cmd prompt. how do i remove the gui?

EDIT 2: Make sure to put a space after “nogui” or else cmd will see it as “noguiPAUSE”. i think it doesnt really recognize new lines as spaces.