Use the jdk version specific headless package on ubuntu

This prevents the installation of two different jdk versions if the
non-default one was specified.