This repository has been archived on 2022-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
manjaroConfiguration/installJava.sh

24 lines
920 B
Bash
Raw Normal View History

2021-11-09 23:08:51 +01:00
# On récupère la dernière version d'AdoptOpenJDK-16
wget -q https://api.github.com/repos/ibmruntimes/semeru16-binaries/releases
echo "Retrieve the last package..."
grep 'browser_download_url": *"' releases | awk '{ print substr ($0, 34 ) }' | awk '{ print substr( $0, 1, length($0)-1 ) }' | sed 's/\"//' | grep 'open-jdk_x64_linux' | grep -zoP '.*gz\n' | sed -n '1p' > url
rm releases
# On télécharge le paquet
wget -q --show-progress -i url -O java.tar.gz
rm url
tar xvzf java.tar.gz
rm java.tar.gz
mv jdk* jdk-16
2021-11-09 23:08:51 +01:00
# On le place dans le dossier /usr/share
2021-11-11 22:48:11 +01:00
if [ -x /usr/share/jdk-16 ] ; then
sudo rm -rf /usr/share/jdk-16
fi
sudo mv jdk-16 /usr/share
2021-11-09 23:08:51 +01:00
# On l'ajoute à la path pour Bash et Fish
2021-11-11 22:45:07 +01:00
echo "export PATH=/usr/share/jdk-16/bin:\$PATH" >> $HOME/.bashrc
if [ -x /usr/bin/fish ] ; then
fish -c 'fish_add_path /usr/share/jdk-16/bin'
fi
2021-11-09 22:43:03 +01:00
echo ""
echo "AdoptOpenJDK 16 is now installed at /usr/share/jdk-16"