Sounds like a good idea! @philwo , @aehlig : WDYT?  @jmillikin-stripe Considering that java8-jdk-headless doesn't exist, should we then change the dependency list from:

> google-jdk | java8-jdk | java8-sdk | oracle-java8-installer

into:

> google-jdk | java8-sdk-headless | oracle-java8-installer

?

The java8-sdk-headless package seems to exist and do the job for Debian and Ubuntu:
https://packages.debian.org/sid/java8-sdk-headless
https://packages.ubuntu.com/zesty/java8-sdk-headless

Not sure why we even had the java8-jdk one in there. `java8-jdk` exists in Debian: https://packages.debian.org/sid/java8-jdk

I'm slightly nervous about changing/removing virtual packages, because they can be mapped to different things on different systems. I think a safe, minimally-intrusive change would be to change the dep to:

`google-jdk | java8-sdk-headless | java8-jdk | java8-sdk | oracle-java8-installer`

That should prioritize the headless version if available, without breaking any existing dependency resolution on Dpkg-based non-Debian systems. Gentle ping.

I could send a PR for this if you want, but someone in the Bazel side would still need to handle updating the Debian packages and such. Note for future readers: the Debian package deps are duplicated, and need to be updated in both `debian/control` and `debian/BUILD`. See https://github.com/bazelbuild/bazel/pull/4686.
Please let the Debian package depend on headless JDK
The official Bazel packages for Debian/Ubuntu depend on `java8-sdk`, which usually resolves to `openjdk-8-jdk`. This is the full JDK including graphical toolkits, and it's fairly bulky when working within a Docker container:

```shell
$ apt-get install --no-install-recommends openjdk-8-jdk
[...]
Need to get 72.8 MB of archives.
After this operation, 384 MB of additional disk space will be used.
```

Since Bazel doesn't have a graphical component, it would be nice if it depended on `java8-sdk-headless`, which is less than half as big:

```shell
$ apt-get install --no-install-recommends openjdk-8-jdk-headless
[...]
Need to get 39.8 MB of archives.
After this operation, 155 MB of additional disk space will be used.
```
scripts/packages/debian/control
scripts/packages/debian/control
diff --git a/scripts/packages/debian/control b/scripts/packages/debian/control
index 443240e5cafdec..fe428fce2eb50f 100644
--- a/scripts/packages/debian/control
+++ b/scripts/packages/debian/control
@@ -9,7 +9,7 @@ Package: bazel
 Section: contrib/devel
 Priority: optional
 Architecture: amd64
-Depends: google-jdk | java8-jdk | java8-sdk | oracle-java8-installer, g++, zlib1g-dev, bash-completion
+Depends: google-jdk | java8-sdk-headless | java8-jdk | java8-sdk | oracle-java8-installer, g++, zlib1g-dev, bash-completion
 Description: Bazel is a tool that automates software builds and tests.
  Supported build tasks include running compilers and linkers to produce
  executable programs and libraries, and assembling deployable packages
