Project

General

Profile

SITools2 Installation on Debian 9 » History » Version 7

Imène Lajili, 05/01/2018 16:51

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 5 Imène Lajili
48 5 Imène Lajili
49 5 Imène Lajili
*  Extract file using below command
50 5 Imène Lajili
<pre>
51 5 Imène Lajili
tar -xvzf jdk-7u80-linux-x64.tar.gz
52 5 Imène Lajili
</pre>
53 5 Imène Lajili
54 6 Imène Lajili
*  Move extracted folder in JDK parent directory 'usr/lib/jvm'
55 5 Imène Lajili
<pre>
56 5 Imène Lajili
sudo mv jdk1.7.0_80 /usr/lib/jvm
57 5 Imène Lajili
</pre>
58 7 Imène Lajili
*  Add the below  system variables to PATH  in /etc/profile
59 5 Imène Lajili
<pre>
60 5 Imène Lajili
JAVA_HOME=/usr/local/java/jdk1.7.0_80
61 5 Imène Lajili
JRE_HOME=/usr/local/java/jdk1.7.0_80
62 5 Imène Lajili
PATH=$PATH : $JRE_HOME/bin : $JAVA_HOME/bin
63 5 Imène Lajili
export JAVA_HOME
64 5 Imène Lajili
export JRE_HOME
65 5 Imène Lajili
export PATH
66 5 Imène Lajili
</pre>
67 5 Imène Lajili
then
68 5 Imène Lajili
<pre>
69 5 Imène Lajili
. /etc/profile
70 5 Imène Lajili
</pre>
71 5 Imène Lajili
72 5 Imène Lajili
Now run below commands to update alternatives
73 5 Imène Lajili
<pre>
74 5 Imène Lajili
sudo update-alternatives --install "/usr/bin/java" "java"  "/usr/lib/jvm/jdk1.7.0_80/bin/java" 
75 5 Imène Lajili
76 5 Imène Lajili
sudo update-alternatives --install "/usr/bin/javac" "javac"  "/usr/lib/jvm/jdk1.6.0_31/bin/javac" 1
77 5 Imène Lajili
78 5 Imène Lajili
sudo update-alternatives --install "/usr/bin/javaws" "javaws"  "/usr/lib/jvm/jdk1.6.0_31/bin/javaws" 1
79 5 Imène Lajili
80 5 Imène Lajili
</pre>
81 5 Imène Lajili
82 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:
83 5 Imène Lajili
84 5 Imène Lajili
<pre>
85 5 Imène Lajili
sudo update-alternatives --config java
86 5 Imène Lajili
There are 4 choices for the alternative java (providing /usr/bin/java).
87 5 Imène Lajili
88 5 Imène Lajili
  Selection    Path                                            Priority   Status
89 5 Imène Lajili
------------------------------------------------------------
90 5 Imène Lajili
  0            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      auto mode
91 5 Imène Lajili
  1            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode
92 5 Imène Lajili
  2            /usr/lib/jvm/jdk1.7.0_76/jre/bin/java            1         manual mode
93 5 Imène Lajili
  3            /usr/lib/jvm/jdk1.7.0_80/bin/java                0         manual mode
94 5 Imène Lajili
* 4            /usr/lib/jvm/jdk1.7.0_80/jre/bin/java            1         manual mode
95 5 Imène Lajili
96 5 Imène Lajili
Press <enter> to keep the current choice[*], or type selection number:
97 5 Imène Lajili
</pre>
98 5 Imène Lajili
99 5 Imène Lajili
100 5 Imène Lajili
101 5 Imène Lajili
102 1 Herve Ballans
h2. Installation of SITools2
103 3 Imène Lajili
104 3 Imène Lajili
To install Sitools2, simply follow the instructions provided by the installation guide available in  sitools official github site: 
105 3 Imène Lajili
https://github.com/SITools2/SITools2-core