Vagrant looking for Java in the wrong directory
I am starting a virtual machine using Vagrant. When I try to start VMware, it keeps giving me the following error:
==> default: The following packages have unmet dependencies:
==> default: openjdk-8-jdk : Depends: openjdk-8-jre (= 8u141-b15-2~14.04) but it is not going to be installed
==> default: Depends: openjdk-8-jdk-headless (= 8u141-b15-2~14.04) but it is not going to be installed
==> default: E: Unable to correct problems, you have held broken packages.
==> default: update-java-alternatives: directory does not exist: /usr/lib/jvm/java-1.8.0-openjdk-amd64
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
What does this mean because I have Java 1.8 on my machine. It is under
/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
which I found by running the command in terminal $/usr/libexec/java_home -v 1.8
How to fix it?
+3
user7933742
source
to share
3 answers
We had the same issue when running an automated build on AWS using CodeBuild:
The following packages have unmet dependencies:
openjdk-8-jdk : Depends: openjdk-8-jre (= 8u141-b15-2~14.04) but it is not going to be installed
Depends: openjdk-8-jdk-headless (= 8u141-b15-2~14.04) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
This is a snippet from the buildspec.yml file that we run:
- apt-get update
- apt-get -y install software-properties-common
- apt-get update
- add-apt-repository -y ppa:openjdk-r/ppa
- apt-get update
- apt-get -y install openjdk-8-jdk
+2
source to share