Search code examples
javaubuntugoogle-cloud-platformgoogle-cloud-datastore

GCP Datastore Emulator won't install on OpenJDK 10


I have a Ubuntu host on which i have installed OpenJDK 10 and Gloud SDK using APT. When i try to install 'google-cloud-sdk-datastore-emulator', i get the error shown below. I found a thread on GCP GitHub that talks about this but its closed. Here - https://github.com/GoogleCloudPlatform/cloud-sdk-docker/issues/144

Anyone else having this issue?

Error -

# apt install google-cloud-sdk-datastore-emulator
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 google-cloud-sdk-datastore-emulator : Depends: openjdk-8-jdk but it is not installable
E: Unable to correct problems, you have held broken packages.

My Environment -

OS -

DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"

OpenJDK -

#java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)
#javac -version
javac 10.0.2
#which java
/usr/bin/java

Gcloud sdk -

# gcloud -v
Google Cloud SDK 234.0.0
alpha 2019.02.08
beta 2019.02.08
bq 2.0.41
core 2019.02.08
gsutil 4.36
kubectl 2019.02.08

Solution

  • There's some issue with our debian package dependancy config. Although if you install the emulator via gcloud command it should work:

    gcloud components install cloud-datastore-emulator

    (https://cloud.google.com/sdk/gcloud/reference/components/install)

    Note the components manager doesn't work if sdk is insalled from other package managers. In this case you can remove it and install following the suggestion here: stackoverflow.com/questions/42697026

    If for some other reason you do have to install via apt-get, https://serverfault.com/questions/250224 should help, basically avoid install openjdk by:

    apt-get install google-cloud-sdk-datastore-emulator openjdk-8-jdk-

    Note there's a "-" after the openjdk-8-jdk

    Or you can follow the steps in the same thread to update package dependancy.