Skip to content

Instantly share code, notes, and snippets.

@konstruktoid
Last active July 30, 2024 07:49
Show Gist options
  • Save konstruktoid/00c37493ef8bfb5d12025cea46a2b970 to your computer and use it in GitHub Desktop.
Save konstruktoid/00c37493ef8bfb5d12025cea46a2b970 to your computer and use it in GitHub Desktop.
#!/bin/sh
MAX_RAM_IN_MB=768
DEBUG=0
if [ -f '/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java' ]; then
JAVA='/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java'
else
JAVA=java
if ! command -v $JAVA 1>/dev/null 2>&1; then
echo "Error: Java is not in the system PATH."
exit 1
fi
fi
JAVA_VERSION_RAW="$("$JAVA" -version 2>&1)"
if ! echo "$JAVA_VERSION_RAW" | grep 'version\s*\("1\.8\.[0-9]*_[0-9]*"\|"9"\|"1[0-9][.-].*"\)'; then
echo "Error: The version of Java you are attempting to use is not compatible with CISCAT:"
echo ""
echo "$JAVA_VERSION_RAW"
echo ""
echo "You must use Java 1.6.x, 1.7.x, or 1.8.x. The most recent version of Java is recommended."
exit 1;
fi
if [ $DEBUG -eq "1" ]; then
"$JAVA" -Xmx${MAX_RAM_IN_MB}M -jar Assessor-CLI.jar "$@" --verbose
else
"$JAVA" -Xmx${MAX_RAM_IN_MB}M -jar Assessor-CLI.jar "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment