1

Run.bat is not functioning.

vexlegends 1/20/20 5:46 pm
1k
1/22/2020 8:30 am
So I have everything downloaded, and when I load up the server through the forge version, it seems just fine, but only loads vanilla 1.12.2. However, when I open the run.bat file, it gives me this:

C:\Users\Owner\Desktop\Server>java -Xmx8192M -Xms8192M -jar forge-1.12.2-14.23.5.2847-universal.jar nogui
Invalid maximum heap size: -Xmx8192M
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

C:\Users\Owner\Desktop\Server>PAUSE
Press any key to continue . . .

Someone, I believe named Azie, replied, but closed the ticket before I could reply. In all fairness, it to me a minute to reply to them, so I understand why they left. Also, they asked for ram and system version: 8 gb and 64 bit. 4/8 gb is what I put into the server, or into that new text document based off a tutorial.

Please help. I don't want to have to pay 15 dollars for a server when I can just do it myself.
Posted by
vexlegends
Level 1 : New Miner
0

  Have something to say?

JoinSign in

9

DiggerMcGee
01/22/2020 8:30 am
Level 64 : High Grandmaster Engineer Wizard
Also, make sure you are running the 64-bit version of Java.
1
ZonkedCompanion
01/22/2020 7:35 am
Level 33 : Artisan Pirate
I know this doesn't really answer your question but it is generally recommended to use the following JVM flags when hosting on 64 bit windows based systems. This will help with server performance by optimising garbage collection.

So assuming you are allocating a max of 4gb I would use the following in your .bat:

java -Xms3G -Xmx4G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar forge-1.12.2-14.23.5.2847-universal.jar


Additionally here is a copy of my servers restart script that you may find useful. It will automatically restart the server on /stop (just paste it into your .bat and edit the java flags and source jar accordingly.) It will log any reboots in a file called start.log with timestamps.


@echo off
:begin
set logfile=start.log
echo %date% %time% Starting server. >> %logfile%
echo Starting server...
echo.
java -Xms10G -Xmx12G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar spigot.jar
echo %date% %time% Server crashed or stopped. >> %logfile%
echo.
echo Do you want to restart?
echo (Close this window now to stop, or press any key to start)
echo.
timeout 10
echo %date% %time% Server restarting. >> %logfile%
echo.
echo Restarting server...
echo.
goto begin
1
slicedbiscuit73
01/22/2020 7:02 am
Level 1 : New Network
you say you don't want to pay 15 dollars for a server but you can find servers that can cost $1.50 to $3.50 a month
1
ZonkedCompanion
01/22/2020 7:49 am
Level 33 : Artisan Pirate
$1.50-3.50 per month for a MC server?! Never seen viable MC hosting that cheap before.

So for that price how much RAM would you get? How many CPU cores do you get? What are the bandwidth limitations? Do they come with SSD storage? Links please...
1
icephantom
01/20/2020 6:14 pm
Level 15 : Journeyman Miner
history
As Geforce has said, the problem is ram allocation. This part of your log file tells the story :
Invalid maximum heap size: -Xmx8192M
The specified size exceeds the maximum representable size.

Your specs suggest a 64bit system with 8gb ram. You will NOT be able to allocate the full 8gb of ram to java since the operating system needs space to operate.
Try -Xmx4096M -Xms4096M as your ram allocation. If you still need more, ram to run your minecraft server, you could try -Xmx5120M -Xms5120M which will allocate 5gb. I would think that this is the max you'll get away with being able to allocate on an 8gb system.
2
vexlegends
01/20/2020 6:21 pm
Level 1 : New Miner
I just did that, and the .bat server loaded just fine. However, when loading up the server, it is still in vanilla. I will add an image to show what's in the folder. https://cdn.discordapp.com/attachments/456937048553685004/668958207586074624/unknown.png Idk what to do.
2
Geforce
01/20/2020 5:52 pm
Level 64 : High Grandmaster Modder
Is your system 32-bit? If it is, you cannot allocate more than 2GB of RAM to a Java process. If your PC is a 64-bit system, install the 64-bit version of Java and try again.
2
vexlegends
01/20/2020 6:11 pm
Level 1 : New Miner
Well, I just did that, but for some reason the world, when I load it, is not modded. Do I need to do anything else with it? I have the mods and stuff in the same folder. Followed this tutorial: www.youtube.com/watch?v=3eZLl1G7avQ
2
icephantom
01/21/2020 1:02 am
Level 15 : Journeyman Miner
history
Well, I wouldn't recommend running a server from a folder on your desktop, best to create a folder outside of anyone's profile, however, that may not let us know why you are ending up with an un-modded server. Since the server runs I assume the eula.txt file has been altered to have a 'true' in it, so that's not a problem. You are running the forge jar which is the correct one to run. What I would suggest next is you change the line :

C:\Users\Owner\Desktop\Server>java -Xmx8192M -Xms8192M -jar forge-1.12.2-14.23.5.2847-universal.jar nogui

to read :

;java -Xmx4096M -Xms4096M -jar forge-1.12.2-14.23.5.2847-universal.jar nogui
2

Welcome