-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathjdkinstaller.sh
executable file
·39 lines (36 loc) · 1.75 KB
/
jdkinstaller.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
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
echo "---> Installing JDK...";
if [ "$jdk" == "openjdk6" ]; \
then apt-get install -y openjdk-6-jdk;
elif [ "$jdk" == "openjdk7" ]; \
then apt-get install -y openjdk-7-jdk;
elif [ "$jdk" == "openjdk8" ]; \
then apt-get install -y openjdk-8-jdk;
elif [ "$jdk" == "openjdk9" ]; \
then apt-get install -y openjdk-9-jdk;
elif [ "$jdk" == "openjdk10" ]; \
then apt-get install -y openjdk-10-jdk;
elif [ "$jdk" == "openjdk11" ]; \
then apt-get install -y openjdk-11-jdk;
elif [ "$jdk" == "oraclejdk6" ]; \
then echo oracle-java6-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java6-installer && \
apt-get install oracle-java6-set-default && \
rm -rf /var/cache/oracle-jdk6-installer;
elif [ "$jdk" == "oraclejdk7" ]; \
then echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java7-installer && \
apt-get install oracle-java7-set-default && \
rm -rf /var/cache/oracle-jdk7-installer;
else
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer && \
apt-get install oracle-java8-set-default && \
rm -rf /var/cache/oracle-jdk8-installer;
fi