#! /bin/sh

PRG=$0
progname=`basename $0`

while [ -h "$PRG" ] ; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '.*/.*' > /dev/null; then
    PRG="$link"
  else
    PRG="`dirname $PRG`/$link"
  fi
done

JPROFILER_HOME=`dirname "$PRG"`/../..
OLDPWD=`pwd`
cd "$JPROFILER_HOME"/bin/macos


LOCALCLASSPATH="../jprofiler.jar:../../.install4j/i4jruntime.jar"
DIRLIBS=../../lib/*.jar
for i in ${DIRLIBS}
do
  LOCALCLASSPATH=$LOCALCLASSPATH:"$i"
done

echo "Using $JAVACMD"


/usr/bin/java -Xdock:icon=../jprofiler.app/Contents/Resources/app.icns -Xdock:name=JProfiler -Dapple.laf.useScreenMenuBar=true -Xmx512m -classpath "$LOCALCLASSPATH" com.jprofiler.frontend.FrontendApplication $@
cd $OLDPWD
