diff --git a/bin/run-coatjava b/bin/run-coatjava new file mode 100755 index 0000000000..ad2c8322d7 --- /dev/null +++ b/bin/run-coatjava @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +. `dirname $0`/../libexec/env.sh + +if [ $# -eq 0 ]; then + echo """ +Run the \`main\` method of any Java class, with the coatjava classpath + + USAGE: $(basename $0) [CLASS_NAME] [CLASS_ARGS] -- [JVM_ARGS] + + CLASS_NAME the full class name + CLASS_ARGS arguments for its \`main\` method + JVM_ARGS arguments for the JVM, overriding defaults + + EXAMPLE - run coatjava's \`DaqScalersSequence\`: + $(basename $0) org.jlab.detector.scalers.DaqScalersSequence \\ + skim_file.hipo -- -XshowSettings + """ + exit 2 +fi + +class_name=$1 +shift + +split_cli $@ + +exec java -Xmx1536m -Xms1024m -XX:+UseSerialGC ${jvm_options[@]} \ + -cp ${COATJAVA_CLASSPATH:-''} \ + $class_name \ + ${class_options[@]}