gpt4 book ai didi

java - Vagrant 在错误的目录中寻找 Java

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:03:13 24 4
gpt4 key购买 nike

我正在使用 Vagrant 运行虚拟机。当我尝试启动(配置)VM 时,它一直给我以下错误:

==> 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.

这是什么意思,因为我的机器上有 Java 1.8。这是在

/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home

这是我通过在终端 $ /usr/libexec/java_home -v 1.8 中运行命令找到的

我该如何解决这个问题?

最佳答案

问题不是因为它在错误的目录中查找。 Vagrant 正在尝试安装 OpenJdk8,但由于某种原因它无法安装 openjdk 依赖项(apt-get 问题)。我知道这一点,因为 2 小时前我们开始遇到同样的问题。

关于java - Vagrant 在错误的目录中寻找 Java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45311128/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com