Last active
May 22, 2020 07:44
-
-
Save gleydson/3d8225bd01cc43ce13c96bab3bdd95c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR=~/ | |
FILE_PROFILE=.profile | |
FILE_BASH=.zshrc | |
DOWNLOADS=Downloads | |
cd ~/Downloads/ | |
wget -c --tries=3 -O ${$DIR$DOWNLOADS}"/jdk.tar.gz http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz?AuthParam=1522841007_f9dd76d4f638494498691469a78af142 | |
tar -xvf ${$DIR$DOWNLOADS}/jdk.tar.gz | |
mv ${$DIR$DOWNLOADS}/jdk-8u161-linux-x64/ /opt/ | |
if [ -e "$DIR$FILE_PROFILE" ] ; then | |
echo "export JAVA_HOME=/opt/jdk-8u161-linux-x64" >> "$DIR$FILE_PROFILE" | |
echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> "$DIR$FILE_PROFILE" | |
echo "export PATH=\$JAVA_HOME/db/bin:\$PATH" >> "$DIR$FILE_PROFILE" | |
echo "export PATH=\$JAVA_HOME/jre/bin:\$PATH" >> "$DIR$FILE_PROFILE" | |
else | |
echo "export JAVA_HOME=/opt/jdk-8u161-linux-x64" >> "$DIR$FILE_BASH" | |
echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> "$DIR$FILE_BASH" | |
echo "export PATH=\$JAVA_HOME/db/bin:\$PATH" >> "$DIR$FILE_BASH" | |
echo "export PATH=\$JAVA_HOME/jre/bin:\$PATH" >> "$DIR$FILE_BASH" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment