Project

General

Profile

SITools2 Installation on Debian 9 » History » Version 9

Version 8 (Imène Lajili, 21/01/2019 16:05) → Version 9/10 (Imène Lajili, 19/09/2019 12:06)

h1. SITools2 Installation on Debian 9

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).
To be reproduced on the SITools2 VMs where version 9 will be released "stable"...

h2. Installation of openjdk-7

SITools2 is incompatible with Java 8
We have to install Java 7. The procedure is a little bit tricky cause the openjdk-7 package doesn't exist for Debian 9.

First, we add a repository containing the package (experimental!) for Stretch (caliu repository) :

<pre>
cat /etc/apt/sources.list
# deb http://inf-mirror/debian/ stretch main

deb http://inf-mirror/debian/ stretch main contrib non-free
deb-src http://inf-mirror/debian/ stretch main contrib non-free

deb http://ftp.caliu.cat/debian/ experimental main contrib non-free
deb-src http://ftp.caliu.cat/debian/ experimental main contrib non-free

deb http://security.debian.org/debian-security stretch/updates main
deb-src http://security.debian.org/debian-security stretch/updates main

</pre>

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 :
https://packages.debian.org/fr/sid/amd64/libjpeg8/download

<pre>
dpkg -i libjpeg8_8d1-2_amd64.deb
</pre>

Finally, just do :

<pre>
aptitude install openjdk-7-jdk
</pre>

h2. Another way to install openjdk-7 in debian 9

* Download the java JDK 7
<pre>
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
</pre>
** Another way to download JDK 7:
<pre>
curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O https://download.oracle.com/otn/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz

</pre>


* Extract file using below command
<pre>
tar -xvzf jdk-7u80-linux-x64.tar.gz
</pre>

* Move extracted folder in JDK parent directory 'usr/lib/jvm'
<pre>
sudo mv jdk1.7.0_80 /usr/lib/jvm
</pre>
* Add the below system variables to PATH in /etc/profile
<pre>
JAVA_HOME=/usr/local/java/jdk1.7.0_80
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH : $JRE_HOME/bin : $JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
</pre>
then
<pre>
. /etc/profile
</pre>

Now run below commands to update alternatives
<pre>
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_80/bin/java"

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_31/bin/javac" 1

sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_31/bin/javaws" 1

</pre>

To see all JDK installed versions use 'sudo update-alternatives --config java' command and your output should be something like this:

<pre>
sudo update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 auto mode
1 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
2 /usr/lib/jvm/jdk1.7.0_76/jre/bin/java 1 manual mode
3 /usr/lib/jvm/jdk1.7.0_80/bin/java 0 manual mode
* 4 /usr/lib/jvm/jdk1.7.0_80/jre/bin/java 1 manual mode

Press <enter> to keep the current choice[*], or type selection number:
</pre>

h2. Installation of SITools2

To install Sitools2, simply follow the instructions provided by the installation guide available in sitools official github site:
https://github.com/SITools2/SITools2-core