appdwarf/apps/mkjava
Phantop 3ebee5f254 appdwarf: Switch to AppImage standard environmental variables as v3.0
Deprecates $APPDWARF_CMD for $ARGV0, as part of the standard
Also finally removes the separate header, as it seems to
not be needed anymore
2022-06-11 15:05:58 -04:00

19 lines
540 B
Bash
Executable file

#!/bin/sh
PATH=$(dirname "$(readlink -f "${0}")")/..:$PATH
DIR=/tmp/appdwarf/java
mkdir -p $DIR
VER=$1
shift
LINK=https://api.adoptium.net/v3/binary/latest/$VER/ga/linux/x64/jdk/hotspot/normal/eclipse
curl -L "$LINK" | tar xz -C$DIR
mv $DIR/jdk* $DIR/jdk
$DIR/jdk/bin/jlink --add-modules ALL-MODULE-PATH --output $DIR/jre --strip-debug --no-man-pages --no-header-files --compress=0
cp "$(dirname "$(readlink -f "${0}")")"/../AppRun $DIR/jre
sed -i 4s#/#/bin/# $DIR/jre/AppRun
appdwarf $DIR/jre "$@"
mv $DIR/jre.sh java"$VER"
rm -rf $DIR