2022-04-13 21:10:51 +00:00
|
|
|
#!/bin/sh
|
2022-01-14 18:41:46 +00:00
|
|
|
PATH=$(dirname "$(readlink -f "${0}")")/..:$PATH
|
2022-03-24 22:25:24 +00:00
|
|
|
DIR=/tmp/appdwarf/java
|
2021-05-15 19:34:16 +00:00
|
|
|
mkdir -p $DIR
|
2022-04-13 21:10:51 +00:00
|
|
|
VER=$1
|
|
|
|
shift
|
2021-12-14 06:45:43 +00:00
|
|
|
|
2022-06-20 19:13:05 +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
|
2022-06-20 19:13:05 +00:00
|
|
|
mv $DIR/jdk* $DIR/jre
|
2021-12-14 06:45:43 +00:00
|
|
|
|
2022-04-13 21:10:51 +00:00
|
|
|
cp "$(dirname "$(readlink -f "${0}")")"/../AppRun $DIR/jre
|
2022-06-11 19:02:34 +00:00
|
|
|
sed -i 4s#/#/bin/# $DIR/jre/AppRun
|
2021-05-15 19:34:16 +00:00
|
|
|
|
2022-04-13 21:10:51 +00:00
|
|
|
appdwarf $DIR/jre "$@"
|
|
|
|
mv $DIR/jre.sh java"$VER"
|
2021-05-15 19:34:16 +00:00
|
|
|
rm -rf $DIR
|