appdwarf/apps/mkjava

18 lines
413 B
Plaintext
Raw Normal View History

#!/bin/sh
2022-01-14 18:41:46 +00:00
PATH=$(dirname "$(readlink -f "${0}")")/..:$PATH
DIR=/tmp/appdwarf/java
2021-05-15 19:34:16 +00:00
mkdir -p $DIR
VER=$1
shift
2021-12-14 06:45:43 +00:00
LINK=https://api.adoptium.net/v3/binary/latest/$VER/ga/linux/x64/jre/hotspot/normal/eclipse
2022-01-14 18:41:46 +00:00
curl -L "$LINK" | tar xz -C$DIR
mv $DIR/jdk* $DIR/jre
2021-12-14 06:45:43 +00:00
cp "$(dirname "$(readlink -f "${0}")")"/../AppRun $DIR/jre
sed -i 4s#/#/bin/# $DIR/jre/AppRun
2021-05-15 19:34:16 +00:00
appdwarf $DIR/jre "$@"
mv $DIR/jre.sh java"$VER"
2021-05-15 19:34:16 +00:00
rm -rf $DIR