Home > Software design >  Error: Could not create the Java Virtual Machine. Spigot Minecraft
Error: Could not create the Java Virtual Machine. Spigot Minecraft

Time:02-17

i'm trying to install spigot server on debian 10, when i run start.sh:

#!/bin/sh
while true
do
java -Xms4G -Xmx4G -XX: UseG1GC -XX: ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 - 
XX: UnlockExperimentalVMOptions -$
echo "restarting in 10"
sleep 10
done

i've got this output: enter image description here

i don't have any idea on how to fix it, any help?

CodePudding user response:

The script seems to require an argument which should be the jar name.

Also, you put a wrong back to break line ("\n") which seems to break the bash.

For me, you should replace -$ by the jar file or spigot, like that:

#!/bin/sh
while true
do
java -Xms4G -Xmx4G -XX: UseG1GC -XX: ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX: UnlockExperimentalVMOptions spigot-1.18.jar
echo "Restarting in 10 seconds"
sleep 10
done

CodePudding user response:

The script is not correct.

#!/bin/sh
while true
do
java -Xms4G -Xmx4G -XX: UseG1GC -XX: ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX: UnlockExperimentalVMOptions -XX: DisableExplicitGC -XX: AlwaysPreTouch -XX:G1NewSizePercent=30 -    XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX: PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar spigot.jar nogui
echo "restarting in 10"
sleep 10
done

Reference: https://www.vultr.com/docs/setup-spigot-on-debian-10/

  • Related