Link Search Menu Expand Document

Java 11 on Ubuntu

(Also: Ubuntu Linux Shell on Chromebooks)


Manually download OpenJDK 11 from, or if you prefer to do this at the command line, use this:


Then extract the tarball into the directory /usr/lib/jvm:

sudo tar xvf openjdk-11.0.1_linux-x64_bin.tar.gz --directory /usr/lib/jvm/

Finally put this in your .profile to adjust your path so that the Java 11 binaries come before others:

if [ -d "$JAVA11" ] ; then

To reexecute your .profile, use:

source .profile

To check that you now have Java 11 as the default version, do this:

java -version

You should see something like this. The “11” that follows openjdk version is the important part.

pconradcis@penguin:~$ java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)