Skip to content

Instantly share code, notes, and snippets.

@henrik242 henrik242/groovy
Created Aug 3, 2016

Embed
What would you like to do?
Poor man's /usr/bin/groovy
#!/usr/bin/env bash
# poor man's /usr/bin/groovy :)
if test -x "$(which java)"; then
JAVAEXEC="$(which java)"
elif test -x "$JAVA_HOME/bin/java"; then
JAVAEXEC="$JAVA_HOME/bin/java"
else
echo "ERROR: Could not find java binary"
exit 1
fi
GROOVYJAR=$(find /path/to/jars -name 'groovy-all-*.jar' -print -quit)
if test -z "$GROOVYJAR"; then
echo "ERROR: Could not find the groovy-all jar!"
exit 1
fi
$JAVAEXEC \
-classpath $GROOVYJAR:. \
org.codehaus.groovy.tools.GroovyStarter \
--main groovy.ui.GroovyMain \
$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.