Install Java on the command line with Debian

Posted in Linux/Unix/BSD -

If it was nice and intuitive to install Java on Debian (and other Debian based distros such as Ubuntu), I wouldn't need to write this post because it would just be "apt-get install java". But no, I always forget what I need to install, hence this post...

Install openjdk-7-jre or openjdk-7-jre-headless

If you just want to install the runtime so you can run Java applications, install either openjdk-7-jre or openjdk-7-jre-headless. The first one will install a bunch of Gnome stuff if not already installed, so if you are doing this on a server without a GUI then install openjdk-7-jre-headless.

sudo apt-get install openjdk-7-jre

OR

sudo apt-get install openjdk-7-jre-headless

Right, now maybe I'll remember this next time :)

This is correct for (at least) Debian 7 & 8, possibly older versions, probably future versions, and possibly other Debian based distributions.



Related posts:


Comments