mirror of
https://github.com/Phantop/appdwarf.git
synced 2025-01-09 13:47:08 +00:00
23 lines
515 B
Bash
Executable file
23 lines
515 B
Bash
Executable file
#!/bin/bash
|
|
PATH=$(dirname $(readlink -f "${0}")):$PATH
|
|
DIR=/tmp/dwarf-portable-executable/java
|
|
mkdir -p $DIR
|
|
curl -L https://api.adoptopenjdk.net/v3/binary/latest/$1/ga/linux/x64/jre/openj9/normal/adoptopenjdk | tar xz -C$DIR
|
|
JDK=$(echo $DIR/jdk*)
|
|
ver=$1
|
|
|
|
cat > $JDK/AppRun << 'EOF'
|
|
#!/bin/sh
|
|
HERE=$(dirname $(readlink -f "${0}"))
|
|
export LD_LIBRARY_PATH="${HERE}":$PATH
|
|
"${HERE}"/bin/java $@
|
|
rm -r ~/javasharedresources
|
|
EOF
|
|
|
|
chmod +x $JDK/AppRun
|
|
|
|
shift
|
|
appdwarf $JDK $@
|
|
mv $(basename $JDK).sh java$ver
|
|
rm -rf $DIR
|