Home > Enterprise >  JVM Startup Flags Not Found
JVM Startup Flags Not Found

Time:04-06

Run the start.sh on Alibaba Cloud Linux 3.2104 64bits

start.sh content:

#!/bin/sh

java -Xms3G -Xmx3G -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 paper.jar nogui

then the console out put:

start.sh: line 4: -XX: UnlockExperimentalVMOptions: command not found
start.sh: line 5: -XX:G1NewSizePercent=30: command not found
start.sh: line 6: -XX:G1ReservePercent=20: command not found
start.sh: line 7: -XX:InitiatingHeapOccupancyPercent=15: command not found
start.sh: line 8: -XX:G1RSetUpdatingPauseTimePercent=5: command not found
start.sh: line 9: -XX:MaxTenuringThreshold=1: command not found
start.sh: line 10: -Daikars.new.flags=true: command not found

java version:

OpenJDK Runtime Environment Corretto-17.0.2.8.1 (build 17.0.2 8-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.2.8.1 (build 17.0.2 8-LTS, mixed mode, sharing)```

I am not a native speaker, sorry for my poor explanation

CodePudding user response:

Your command has multiple lines - in bash shell this must all be on one line or use the line continuation character. So you have two choices:

All on one line:

java -Xms3G -Xmx3G -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 paper.jar nogui

or use a line continuation

java -Xms3G -Xmx3G -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 paper.jar nogui
  • Related