Install OpenJDK9 in snap

I’m trying to install OpenJDK 9 as a build dependency in snapcraft. However, it fails with the following error:

Can not install 'openjdk-9-jdk' because it tries to overwrite file aready included in 'openjdk-9-jdk-headless'

Looks like this is due to this bug, and a workaround is therefore running:

sudo apt-get -o Dpkg::Options::="--force-overwrite" install openjdk-9-jdk

Is there any way to pass these options to apt / emulate this in a snapcraft file so openjdk can be installed?

What is the reason to install both packages ? if you actually need the full jdk, just pick that in your build-packages/stage-packages, else pick the cut down -headless version …

I need the full JDK - but openjdk-9-jdk has a hard dependency on openjdk-9-jdk-headless (hence the above bug.) I’m not specifying openjdk-9-jdk-headless at all…