-
Notifications
You must be signed in to change notification settings - Fork 2
/
java8.sh
30 lines (21 loc) · 1.02 KB
/
java8.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
RED='\033[0;31m'
NC='\033[0m'
printf "*********${RED}Java 8 installation${NC}*********\n"
#Downloading java 8 jre
wget --no-check-certificate --no-cookies --header \
"Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.tar.gz
sudo mkdir -p /usr/lib64/jvm
#Installing java 8 jre
tar -xf jdk-8u92-linux-x64.tar.gz -C /usr/lib64/jvm
rm jdk-8u92-linux-x64.tar.gz
update-alternatives --install /usr/bin/javaws javaws /usr/lib64/jvm/jdk1.8.0_92/bin/javaws 1 && \
update-alternatives --install /usr/bin/javac javac /usr/lib64/jvm/jdk1.8.0_92/bin/javac 1 && \
update-alternatives --install /usr/bin/java java /usr/lib64/jvm/jdk1.8.0_92/bin/java 1 && \
update-alternatives --set javac /usr/lib64/jvm/jdk1.8.0_92/bin/javac && \
update-alternatives --set java /usr/lib64/jvm/jdk1.8.0_92/bin/java && \
update-alternatives --set javaws /usr/lib64/jvm/jdk1.8.0_92/bin/javaws
#Updating variables.sh
export JAVA_HOME=/usr/lib64/jvm
export PATH=$JAVA_HOME/bin:$PATH