Project

General

Profile

SITools2 Installation on Debian 9 » History » Version 10

Imène Lajili, 19/09/2019 16:05

1 1 Herve Ballans
h1. SITools2 Installation on Debian 9
2 1 Herve Ballans
3 1 Herve Ballans
For maintenance reasons (especially system updates), we test the installation of SITools2 on the last version of debian (Stretch which is currently not yet stable).
4 4 Herve Ballans
To be reproduced on the SITools2 VMs where version 9 will be released "stable"...
5 1 Herve Ballans
6 1 Herve Ballans
h2. Installation of openjdk-7
7 1 Herve Ballans
8 1 Herve Ballans
SITools2 is incompatible with Java 8
9 1 Herve Ballans
We have to install Java 7. The procedure is a little bit tricky cause the openjdk-7 package doesn't exist for Debian 9.
10 1 Herve Ballans
11 4 Herve Ballans
First, we add a repository containing the package (experimental!) for Stretch (caliu repository) :
12 4 Herve Ballans
13 2 Imène Lajili
<pre>
14 2 Imène Lajili
cat /etc/apt/sources.list
15 2 Imène Lajili
# deb http://inf-mirror/debian/ stretch main
16 2 Imène Lajili
17 2 Imène Lajili
deb http://inf-mirror/debian/ stretch main contrib non-free
18 2 Imène Lajili
deb-src http://inf-mirror/debian/ stretch main contrib non-free
19 2 Imène Lajili
20 2 Imène Lajili
deb http://ftp.caliu.cat/debian/ experimental main contrib non-free
21 2 Imène Lajili
deb-src http://ftp.caliu.cat/debian/ experimental main contrib non-free
22 2 Imène Lajili
23 2 Imène Lajili
deb http://security.debian.org/debian-security stretch/updates main
24 2 Imène Lajili
deb-src http://security.debian.org/debian-security stretch/updates main
25 2 Imène Lajili
26 1 Herve Ballans
</pre>
27 2 Imène Lajili
28 4 Herve Ballans
But the installation doen't work due to the missing of libjpeg8 library in Stretch. In order to solve this libjpeg8 problem, we have to install the 'sid' package version, here :
29 2 Imène Lajili
https://packages.debian.org/fr/sid/amd64/libjpeg8/download
30 2 Imène Lajili
31 2 Imène Lajili
<pre>
32 1 Herve Ballans
dpkg -i libjpeg8_8d1-2_amd64.deb
33 1 Herve Ballans
</pre>
34 4 Herve Ballans
35 4 Herve Ballans
Finally, just do :
36 2 Imène Lajili
37 2 Imène Lajili
<pre>
38 2 Imène Lajili
aptitude install openjdk-7-jdk
39 2 Imène Lajili
</pre>
40 2 Imène Lajili
41 5 Imène Lajili
h2.  Another way to install openjdk-7 in debian 9
42 5 Imène Lajili
43 5 Imène Lajili
*  Download the java JDK 7
44 5 Imène Lajili
<pre>
45 5 Imène Lajili
sudo wget --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie" --user=Oracleaccount-username --ask-password  http://download.oracle.com/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
46 5 Imène Lajili
</pre>
47 9 Imène Lajili
**  Another way to download JDK 7:
48 9 Imène Lajili
<pre>
49 9 Imène Lajili
   curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O https://download.oracle.com/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz
50 9 Imène Lajili
51 9 Imène Lajili
</pre>
52 5 Imène Lajili
53 5 Imène Lajili
54 5 Imène Lajili
*  Extract file using below command
55 5 Imène Lajili
<pre>
56 5 Imène Lajili
tar -xvzf jdk-7u80-linux-x64.tar.gz
57 5 Imène Lajili
</pre>
58 5 Imène Lajili
59 6 Imène Lajili
*  Move extracted folder in JDK parent directory 'usr/lib/jvm'
60 5 Imène Lajili
<pre>
61 10 Imène Lajili
sudo mv jdk1.7.0_80 /usr/lib/jvm/jdk1.7_80
62 5 Imène Lajili
</pre>
63 7 Imène Lajili
*  Add the below  system variables to PATH  in /etc/profile
64 5 Imène Lajili
<pre>
65 5 Imène Lajili
JAVA_HOME=/usr/local/java/jdk1.7.0_80
66 8 Imène Lajili
JRE_HOME=$JAVA_HOME/jre
67 5 Imène Lajili
PATH=$PATH : $JRE_HOME/bin : $JAVA_HOME/bin
68 5 Imène Lajili
export JAVA_HOME
69 5 Imène Lajili
export JRE_HOME
70 5 Imène Lajili
export PATH
71 5 Imène Lajili
</pre>
72 5 Imène Lajili
then
73 5 Imène Lajili
<pre>
74 5 Imène Lajili
. /etc/profile
75 5 Imène Lajili
</pre>
76 5 Imène Lajili
77 5 Imène Lajili
Now run below commands to update alternatives
78 5 Imène Lajili
<pre>
79 5 Imène Lajili
sudo update-alternatives --install "/usr/bin/java" "java"  "/usr/lib/jvm/jdk1.7.0_80/bin/java" 
80 1 Herve Ballans
81 10 Imène Lajili
</pre>
82 10 Imène Lajili
What is below is optional
83 10 Imène Lajili
<pre>
84 5 Imène Lajili
sudo update-alternatives --install "/usr/bin/javac" "javac"  "/usr/lib/jvm/jdk1.6.0_31/bin/javac" 1
85 5 Imène Lajili
86 5 Imène Lajili
sudo update-alternatives --install "/usr/bin/javaws" "javaws"  "/usr/lib/jvm/jdk1.6.0_31/bin/javaws" 1
87 5 Imène Lajili
88 5 Imène Lajili
</pre>
89 5 Imène Lajili
90 7 Imène Lajili
To see all JDK installed versions use 'sudo update-alternatives --config java' command and your output should be something like this:
91 5 Imène Lajili
92 5 Imène Lajili
<pre>
93 5 Imène Lajili
sudo update-alternatives --config java
94 5 Imène Lajili
There are 4 choices for the alternative java (providing /usr/bin/java).
95 5 Imène Lajili
96 5 Imène Lajili
  Selection    Path                                            Priority   Status
97 5 Imène Lajili
------------------------------------------------------------
98 5 Imène Lajili
  0            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      auto mode
99 5 Imène Lajili
  1            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode
100 5 Imène Lajili
  2            /usr/lib/jvm/jdk1.7.0_76/jre/bin/java            1         manual mode
101 5 Imène Lajili
  3            /usr/lib/jvm/jdk1.7.0_80/bin/java                0         manual mode
102 5 Imène Lajili
* 4            /usr/lib/jvm/jdk1.7.0_80/jre/bin/java            1         manual mode
103 5 Imène Lajili
104 5 Imène Lajili
Press <enter> to keep the current choice[*], or type selection number:
105 5 Imène Lajili
</pre>
106 5 Imène Lajili
107 1 Herve Ballans
h2. Installation of SITools2
108 3 Imène Lajili
109 3 Imène Lajili
To install Sitools2, simply follow the instructions provided by the installation guide available in  sitools official github site: 
110 3 Imène Lajili
https://github.com/SITools2/SITools2-core