Wednesday, November 25, 2015

Install Java JDK/JRE on Debian jessie with 'apt-get install'

Issue: default JDK for Debian 8 is JDK 7. I need a maintainable way to upgrade it to JDK 8.

Steps:

1. Edin file /etc/apt/sources.list and add this line on the bottom:
deb http://http.debian.net/debian jessie-backports main

2. sudo apt-get update

3. sudo apt-get install openjdk-8-jdk

4. test it as this:
java -version

If the result shows version 7, you could check the names of JDK7 packages and remove them
4.1. Check older JDK packages:
dpkg -l | grep openjdk

4.2. Remove your older JDK packages, e.g.:
apt-get purge openjdk-7-jdk
apt-get purge openjdk-7-jre
apt-get purge openjdk-7-jre-headless



Solved.

No comments:

Post a Comment