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