view analyzer/fx/heapstats-analyzer.in @ 252:6fd99b983c37

Bug 3464: Fix launcher and attacher to use on Ubuntu Reviewed-by: yasuenag https://github.com/HeapStats/heapstats/pull/124
author KUBOTA Yuji <kubota.yuji@lab.ntt.co.jp>
date Tue, 10 Oct 2017 23:39:34 +0900
parents 5ee1c4138b61
children
line wrap: on
line source

#!/bin/bash

prefix=@prefix@
exec_prefix=@exec_prefix@
libexecdir=@libexecdir@

ANALYZER_JAR="$libexecdir/heapstats-analyzer.jar"
# Check Analyzer
if test ! -f "$ANALYZER_JAR" ; then
  echo "Analyzer not found at $libexecdir, try to find heapstats-analyzer.jar instead"
  ANALYZER_JAR=$(find . -name "heapstats-analyzer.jar" | head -n 1)
  if test ! -f "$ANALYZER_JAR" ; then
    echo "Analyzer not found"
    exit 2
  fi
fi

if test -x $JAVA_HOME/bin/java; then
  $JAVA_HOME/bin/java $JAVA_OPTS -jar $ANALYZER_JAR $@
elif test -z "$JAVA_HOME"; then
  echo "Set \$JAVA_HOME to run heapstats-analyzer"
else
  echo "Set \$JAVA_HOME correctly to run heapstats-analyzer"
fi