-
Notifications
You must be signed in to change notification settings - Fork 1
/
java90.sh
50 lines (37 loc) · 946 Bytes
/
java90.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
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
JAVA=/usr/java
JDK=$JAVA/jdk-9.0.4
# Install Java 8
if [ -d "$JDK" ]
then
echo "Java 9.0 is already installed, nothing done!"
else
source /vagrant/vagrant-setup/include.sh
# Install Java 9
# Can also be downloaded from
# http://download.java.net/java/GA/jdk9/9/binaries/jdk-9+181_linux-x64_bin.tar.gz
RPM=c2514751926b4512b076cc82f959763f/jdk-9.0.4_linux-x64_bin.rpm
OTN=otn/java/jdk/9.0.4+11
if [ ! -f "$SETUP/cache/$RPM" ]
then
echo "Downloading JDK 9.0"
wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/$OTN/$RPM" -P $SETUP/cache
fi
rpm -Uvh $SETUP/cache/$RPM
cd /etc/alternatives
if [ -L "jre" ]
then
unlink jre > /dev/null 2>&1
fi
if [ -L "jre" ]
then
unlink jre_exports > /dev/null 2>&1
fi
# ln -s $JDK/jre jre
if [ -L "latest" ]
then
unlink latest > /dev/null 2>&1
fi
ln -s $JDK latest
cd $PPWD
fi