Skip to content

Instantly share code, notes, and snippets.

@Peregrinox
Last active March 7, 2018 08:48
Show Gist options
  • Save Peregrinox/a5b72790fe5bc6ab4f01d149514e7101 to your computer and use it in GitHub Desktop.
Save Peregrinox/a5b72790fe5bc6ab4f01d149514e7101 to your computer and use it in GitHub Desktop.
install java 8 on osmc

[https://discourse.osmc.tv/t/java-8-in-osmc/22369/8]

To enable Stretch backports and make its contents available, do something like:

echo deb http://ftp.debian.org/debian stretch-backports main | sudo tee --append /etc/apt/sources.list
sudo apt-get update

To install the JRE package, there's a special quirk:

$ sudo apt-get -t stretch-backports install openjdk-8-jre-headless

If "-t stretch-backports" is not included, it complains of a dependency problem and won't install.

After this, verify Java 8 is installed.

$ java -version
sudo apt-get install libjna-java

Configure JAVA_HOME (recommended)

https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-debian-8

$ sudo update-alternatives --config java

Copy the path from your preferred installation, and then open /etc/environment using nano or your favorite text editor.

sudo nano /etc/environment

In this file, add the following line, making sure to replace the path with your own copied path.

JAVA_HOME="/usr/lib/jvm/java-8-openjdk-armhf"

Save and exit the file, and reload it with:

source /etc/environment

You can now test whether the environment variable has been set:

echo $JAVA_HOME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment