summaryrefslogtreecommitdiff
path: root/artix/home/.local/bin/exestub.sh
diff options
context:
space:
mode:
authorNantha Sorubakanthan <nantha@mielota.com>2026-04-13 21:45:43 +0200
committerNantha Sorubakanthan <nantha@mielota.com>2026-04-13 21:45:43 +0200
commit0c913f1e421b9d47c052350c4c1d619e4ac6a297 (patch)
treec9124ff04b9252836221c41d2ca2fa133d166251 /artix/home/.local/bin/exestub.sh
Initial commit
Diffstat (limited to 'artix/home/.local/bin/exestub.sh')
-rw-r--r--artix/home/.local/bin/exestub.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/artix/home/.local/bin/exestub.sh b/artix/home/.local/bin/exestub.sh
new file mode 100644
index 0000000..33ac55a
--- /dev/null
+++ b/artix/home/.local/bin/exestub.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# https://stackoverflow.com/questions/4330936/how-can-i-convert-a-jar-to-an-exe
+
+MYSELF=`which "$0" 2>/dev/null`
+[ $? -gt 0 -a -f "$0" ] && MYSELF="./$0"
+JAVA_OPT=""
+PROG_OPT=""
+
+while [ $# -gt 0 ] ; do
+ case $1 in
+ -Xm*) JAVA_OPT="$JAVA_OPT $1" ;;
+ -D*) JAVA_OPT="$JAVA_OPT $1" ;;
+ *) PROG_OPT="$PROG_OPT $1" ;;
+ esac
+ shift
+done
+
+exec java $JAVA_OPT -jar $MYSELF $PROG_OPT