Installing JDK 8 on a Debian-based GNU/Linux system

Search
Feedback

Java JDK 8 is a prerequisite for running Structr. On a Debian-based GNU/Linux system, these are the steps to check and install the neccessary Java JDK 8:

Check Java Version

root@localhost:~# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

If JDK 7 is still installed, update to JDK 8.

Install apt-add-repository

The package apt-add-repository is a prerequisite for the following installation process. If apt-add-repository is not available on the system, you need to install the package software-properties-common.

apt-get install software-properties-common

Install Java JDK 8

apt-add-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java8-installer
Make JDK 8 the System’s default
update-alternatives --config java
update-alternatives --config javac

Select the matching option.

Check Java and Maven versions

root@localhost:~# java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
root@localhost:~# mvn -version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /opt/jdk1.7.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.18.9-x86_64-jb1", arch: "amd64", family: "unix"

If Maven is still using JDK 7:

De-install old JDK

apt-get purge oracle-java7-installer openjdk-6-jre-headless:amd64 openjdk-6-jre-lib openjdk-7-jre-headless:amd64

If you’ve got a JDK installed in a custom location, f.e. /opt/jdk1.7.0_45:

Remove custom JDK

rm -rf /opt/jdk1.7.0_45

Deactivate custom settings for JAVA_HOME

#export JAVA_HOME=/opt/jdk1.7.0_45

Sometimes it might be neccessary to logout and login again to have the new JDK version available.

You should check the Java version used by maven:

root@localhost:~# mvn -version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.18.9-x86_64-jb1", arch: "amd64", family: "unix"

Graph-Browser

About this article
Last change 2016-10-07
Topics Structr 2.0