mirror of
https://github.com/Phantop/appdwarf.git
synced 2025-01-09 13:47:08 +00:00
Update mkjava to fixed adoptium api
This commit is contained in:
parent
2dc2bce930
commit
2f810ade3e
21
mkjava
21
mkjava
|
@ -1,24 +1,25 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PATH=$(dirname $(readlink -f "${0}")):$PATH
|
PATH=$(dirname $(readlink -f "${0}")):$PATH
|
||||||
DIR=/tmp/dwarf-portable-executable/java
|
DIR=/tmp/dwarf-portable-executable/java
|
||||||
|
JRE=$DIR/jre
|
||||||
|
VER=$1
|
||||||
mkdir -p $DIR
|
mkdir -p $DIR
|
||||||
LINK=$(curl https://api.github.com/repos/adoptium/temurin$1-binaries/releases/latest | jq .assets[].browser_download_url | grep 'jdk_x64_linux_hotspot' | cut -d\" -f2)
|
|
||||||
curl -L $LINK | tar xz -C$DIR
|
|
||||||
$DIR/jdk*/bin/jlink --add-modules ALL-MODULE-PATH --output $DIR/jre --strip-debug --no-man-pages --no-header-files --compress=0
|
|
||||||
JDK=$DIR/jre
|
|
||||||
ver=$1
|
|
||||||
|
|
||||||
cat > $JDK/AppRun << 'EOF'
|
LINK=https://api.adoptium.net/v3/binary/latest/$1/ga/linux/x64/jdk/hotspot/normal/eclipse
|
||||||
|
curl -L $LINK | tar xz -C$DIR
|
||||||
|
$DIR/jdk*/bin/jlink --add-modules ALL-MODULE-PATH --output $JRE --strip-debug --no-man-pages --no-header-files --compress=0
|
||||||
|
|
||||||
|
|
||||||
|
cat > $JRE/AppRun << 'EOF'
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
HERE=$(dirname $(readlink -f "${0}"))
|
HERE=$(dirname $(readlink -f "${0}"))
|
||||||
export LD_LIBRARY_PATH="${HERE}":$PATH
|
export LD_LIBRARY_PATH="${HERE}":$PATH
|
||||||
"${HERE}"/bin/java $@
|
"${HERE}"/bin/java $@
|
||||||
rm -r ~/javasharedresources
|
rm -r ~/javasharedresources
|
||||||
EOF
|
EOF
|
||||||
|
chmod +x $JRE/AppRun
|
||||||
chmod +x $JDK/AppRun
|
|
||||||
|
|
||||||
shift
|
shift
|
||||||
appdwarf $JDK $@
|
appdwarf $JRE $@
|
||||||
mv $(basename $JDK).sh java$ver
|
mv $(basename $JRE).sh java$VER
|
||||||
rm -rf $DIR
|
rm -rf $DIR
|
||||||
|
|
Loading…
Reference in a new issue