Skip to content

Instantly share code, notes, and snippets.

@navicore
Last active August 29, 2015 14:01
Show Gist options
  • Save navicore/9d2d833e36f644bef90b to your computer and use it in GitHub Desktop.
Save navicore/9d2d833e36f644bef90b to your computer and use it in GitHub Desktop.
bash to build classpath from directory of jars
#!/bin/sh
PROJECT_DIR="$(cd `dirname $0`; pwd)"
PROJECT_JAR="none"
for entry in "build/libs"/*
do
PROJECT_JAR=$entry
echo "running $entry"
break
done
CLASSPATH+=:$PROJECT_JAR
for jar in `find $PROJECT_DIR/build/dist -name '*jar'`; do
CLASSPATH+=:$jar
done
#java $JAVA_OPTS -jar $PROJECT_JAR -c -t $1 -B localhost:9092
java -cp $CLASSPATH $JAVA_OPTS my.package.Main -c -t $1 -B localhost:9092
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment