From 0845de0a7c187644bcd3e2f6c14d4a3e998c6054 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Tue, 14 Jun 2022 17:21:46 +0000 Subject: [PATCH] run scripts updated with java optimal options Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- Java/scripts/build.sh | 10 +++++++++- Java/scripts/build2.sh | 10 +++++++++- runGame.command | 13 ++++++++++++- runGame.ps1 | 10 ++++++++++ runGame.sh | 13 ++++++++++++- 5 files changed, 52 insertions(+), 4 deletions(-) diff --git a/Java/scripts/build.sh b/Java/scripts/build.sh index e176940..332aac7 100755 --- a/Java/scripts/build.sh +++ b/Java/scripts/build.sh @@ -5,5 +5,13 @@ javac -source ${SOURCE_VERSION} -target ${TARGET_VERSION} -Xlint:unchecked -cp $ printf "\n\n\nRunning Program...\n\n" ORIGINAL_LOC=$(pwd) cd $OUT_DIR -java ${CUSTOM_PARAMS} -cp .:../lib/bin/ -Djava.library.path="${LIBRARY_PATH}" ${MAIN_CLASS} "$@" +if java ${CUSTOM_PARAMS} -cp .:../lib/bin/ -XX:+UseZGC -Djava.library.path="${LIBRARY_PATH}" ${MAIN_CLASS} "$@"; then + ${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh + return +fi +if java ${CUSTOM_PARAMS} -cp .:../lib/bin/ -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Djava.library.path="${LIBRARY_PATH}" ${MAIN_CLASS} "$@"; then + ${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh + return +fi +java ${CUSTOM_PARAMS} -cp .:../lib/bin/ -XX:+PrintCommandLineFlags -Djava.library.path="${LIBRARY_PATH}" ${MAIN_CLASS} "$@" ${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh \ No newline at end of file diff --git a/Java/scripts/build2.sh b/Java/scripts/build2.sh index bbcced0..59f636f 100644 --- a/Java/scripts/build2.sh +++ b/Java/scripts/build2.sh @@ -5,5 +5,13 @@ javac -source ${SOURCE_VERSION} -target ${TARGET_VERSION} -Xlint:unchecked -cp $ printf "\n\n\nRunning Program...\n\n" ORIGINAL_LOC=$(pwd) cd $OUT_DIR -java ${CUSTOM_PARAMS} -cp ".;../lib/bin/ " "-Djava.library.path=${LIBRARY_PATH}" ${MAIN_CLASS} "$@" +if java ${CUSTOM_PARAMS} -cp ".;../lib/bin/" -XX:+UseZGC "-Djava.library.path=${LIBRARY_PATH}" ${MAIN_CLASS} "$@"; then + ${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh + return +fi +if java ${CUSTOM_PARAMS} -cp ".;../lib/bin/" -XX:+UnlockExperimentalVMOptions -XX:+UseZGC "-Djava.library.path=${LIBRARY_PATH}" ${MAIN_CLASS} "$@"; then + ${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh + return +fi +java ${CUSTOM_PARAMS} -cp ".;../lib/bin/" -XX:+PrintCommandLineFlags "-Djava.library.path=${LIBRARY_PATH}" ${MAIN_CLASS} "$@" ${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh \ No newline at end of file diff --git a/runGame.command b/runGame.command index bb8207f..686d505 100755 --- a/runGame.command +++ b/runGame.command @@ -1,3 +1,14 @@ cd bin -java -Djava.library.path="../lib" -Xms2G -Xmx2G -XX:+PrintCommandLineFlags -jar RabiClone.jar +if java -Djava.library.path="../lib" -Xms2G -Xmx2G -XX:+UseZGC -XX:+PrintCommandLineFlags -jar RabiClone.jar; then + cd .. + return +fi +if java -Djava.library.path="../lib" -Xms2G -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+PrintCommandLineFlags -jar RabiClone.jar; then + cd .. + return +fi +if java -Djava.library.path="../lib" -Xms2G -Xmx2G -XX:+PrintCommandLineFlags -jar RabiClone.jar; then + cd .. + return +fi cd .. \ No newline at end of file diff --git a/runGame.ps1 b/runGame.ps1 index 72a6624..036abe8 100755 --- a/runGame.ps1 +++ b/runGame.ps1 @@ -1,3 +1,13 @@ cd bin +java "-Djava.library.path=../lib" -Xms2G -Xmx2G -XX:+UseZGC -XX:+PrintCommandLineFlags -jar RabiClone.jar +if ($? -eq $True) { + cd .. + return +} +java "-Djava.library.path=../lib" -Xms2G -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+PrintCommandLineFlags -jar RabiClone.jar +if ($? -eq $True) { + cd .. + return +} java "-Djava.library.path=../lib" -Xms2G -Xmx2G -XX:+PrintCommandLineFlags -jar RabiClone.jar cd .. \ No newline at end of file diff --git a/runGame.sh b/runGame.sh index bb8207f..686d505 100755 --- a/runGame.sh +++ b/runGame.sh @@ -1,3 +1,14 @@ cd bin -java -Djava.library.path="../lib" -Xms2G -Xmx2G -XX:+PrintCommandLineFlags -jar RabiClone.jar +if java -Djava.library.path="../lib" -Xms2G -Xmx2G -XX:+UseZGC -XX:+PrintCommandLineFlags -jar RabiClone.jar; then + cd .. + return +fi +if java -Djava.library.path="../lib" -Xms2G -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:+PrintCommandLineFlags -jar RabiClone.jar; then + cd .. + return +fi +if java -Djava.library.path="../lib" -Xms2G -Xmx2G -XX:+PrintCommandLineFlags -jar RabiClone.jar; then + cd .. + return +fi cd .. \ No newline at end of file