-
Notifications
You must be signed in to change notification settings - Fork 1
/
java80.sh
91 lines (74 loc) · 2.08 KB
/
java80.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
JAVA=/usr/java
JDK=$JAVA/jdk1.8.0_162
# Install Java 8
if [ -d "$JDK" ]
then
echo "Java 8.0 is already installed, nothing done!"
else
source /vagrant/vagrant-setup/include.sh
# Install Java 8
# RPM=jdk-8u5-linux-x64.rpm
# OTN=otn-pub/java/jdk/8u5-b13
# RPM=jdk-8u112-linux-x64.rpm
# OTN=otn/java/jdk/8u112-b15
# RPM=jdk-8u131-linux-x64.rpm
# OTN=otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163
RPM=jdk-8u162-linux-x64.rpm
OTN=otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1
if [ ! -f "$SETUP/cache/$RPM" ]
then
echo "Downloading JDK 8.0"
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/$OTN/$RPM" -P $SETUP/cache
fi
rpm -Uvh $SETUP/cache/$RPM
# Install JAI 1.1.3
# http://download.java.net/media/jai/builds/release/1_1_3/INSTALL.html
cd $JAVA
if [ ! -f "$SETUP/cache/jai-1_1_3-lib-linux-amd64-jdk.bin" ]
then
echo "Downloading JAI 1.1.3"
wget http://download.java.net/media/jai/builds/release/1_1_3/jai-1_1_3-lib-linux-amd64-jdk.bin -P $SETUP/cache
chmod u+x -P $SETUP/cache/jai-1_1_3-lib-linux-amd64-jdk.bin
fi
if [ -f "$SETUP/cache/jai-1_1_3-lib-linux-amd64-jdk.bin" ]
then
cd $JDK
echo "Installing JAI 1.1.3"
echo -e "y\n" | $SETUP/cache/jai-1_1_3-lib-linux-amd64-jdk.bin
else
echo "Warning. Failed to download JAI. Skiping its installation!"
fi
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
cd $JAVA
if [ -L "default" ]
then
unlink default > /dev/null 2>&1
fi
ln -s $JDK default
if [ -L "latest" ]
then
unlink latest > /dev/null 2>&1
fi
ln -s $JDK latest
# Required only if there was a previous Java 7 installation that is being replaced
# BINS=( java keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 )
# for NM in "${BINS[@]}"
# do
# if [ -L "$NM" ]
# then
# unlink $NM.1.gz > /dev/null 2>&1
# fi
# ln -s $JDK/bin/$NM $NM
# done
cd $PPWD
fi