This instruction fully tested under Ubuntu 14.04 LTS 64-bit, Java 1.8.0_25 64-bit.
Create a stub.sh file with this content:
#!/bin/sh
MYSELF=`which "$0" 2>/dev/null`
[ $? -gt 0 -a -f "$0" ] && MYSELF="./$0"
java=java
if test -n "$JAVA_HOME"; then
java="$JAVA_HOME/bin/java"
fi
exec "$java" $java_args -jar $MYSELF "$@"
exit 1
Pack your project into a runnable uberjar and run:
cat stub.sh app.jar > app && chmod +x app
It seems that the created app is steel a valid jar.