Skip to content

Instantly share code, notes, and snippets.

@ramonpin
Created October 30, 2018 17:23
Show Gist options
  • Save ramonpin/81365a5e48fb74764ace4e35d1cad90a to your computer and use it in GitHub Desktop.
Save ramonpin/81365a5e48fb74764ace4e35d1cad90a to your computer and use it in GitHub Desktop.

Instruction

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
@ramonpin
Copy link
Author

It seems that the created app is steel a valid jar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment