2021-05-15 19:34:16 +00:00
|
|
|
#!/bin/bash
|
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-12-14 06:45:43 +00:00
|
|
|
JRE=$DIR/jre
|
|
|
|
VER=$1
|
2021-05-15 19:34:16 +00:00
|
|
|
mkdir -p $DIR
|
2021-12-14 06:45:43 +00:00
|
|
|
|
|
|
|
LINK=https://api.adoptium.net/v3/binary/latest/$1/ga/linux/x64/jdk/hotspot/normal/eclipse
|
2022-01-14 18:41:46 +00:00
|
|
|
curl -L "$LINK" | tar xz -C$DIR
|
2021-12-14 06:45:43 +00:00
|
|
|
$DIR/jdk*/bin/jlink --add-modules ALL-MODULE-PATH --output $JRE --strip-debug --no-man-pages --no-header-files --compress=0
|
|
|
|
|
2021-05-15 19:34:16 +00:00
|
|
|
|
2021-12-14 06:45:43 +00:00
|
|
|
cat > $JRE/AppRun << 'EOF'
|
2021-05-15 19:34:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
HERE=$(dirname $(readlink -f "${0}"))
|
|
|
|
export LD_LIBRARY_PATH="${HERE}":$PATH
|
|
|
|
"${HERE}"/bin/java $@
|
|
|
|
rm -r ~/javasharedresources
|
|
|
|
EOF
|
2021-12-14 06:45:43 +00:00
|
|
|
chmod +x $JRE/AppRun
|
2021-05-15 19:34:16 +00:00
|
|
|
|
2021-10-28 17:20:08 +00:00
|
|
|
shift
|
2021-12-14 06:45:43 +00:00
|
|
|
appdwarf $JRE $@
|
2022-01-14 18:41:46 +00:00
|
|
|
mv $JRE.sh java"$VER"
|
2021-05-15 19:34:16 +00:00
|
|
|
rm -rf $DIR
|