错误:“"无法找到与版本"1.8"匹配的任何JVM. [英] Error:" Unable to find any JVMs matching version "1.8"."

查看:136
本文介绍了错误:“"无法找到与版本"1.8"匹配的任何JVM.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行Flutter创建X或Flutter Doctor时,我收到以下消息 找不到与版本1.8匹配的JVM.

When I run flutter create x or flutter doctor I get the following message "Unable to find any JVMs matching version 1.8.

我也尝试在StackOverFlow上关注另一个线程,但是它没有帮助,因为如果您已经安装了Java,它没有指定要执行的操作.当我运行java-version时,我收到以下消息:

I also tried following another thread on StackOverFlow for this issue but it did not help because it did not specify what to do if you already have java installed. At the moment when I run java-version I get the following message:

java版本13.0.1 2019-10-15 Java(TM)SE运行时环境(内部版本13.0.1 + 9) Java HotSpot(TM)64位服务器VM(内部版本13.0.1 + 9,混合模式,共享)

java version 13.0.1 2019-10-15 Java(TM) SE Runtime Environment (build 13.0.1+9) Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

预先感谢您的帮助!

我找到了解决方法!

echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)" >> ~/.bash_profile

我所做的就是用已经安装的JDK替换1.7,现在它可以工作了.该线程可以在下面找到:

All I did was replace 1.7 with a JDK I already had installed and now it works. The thread can be found below:

如何设置在Mac OS X 10.9上是JAVA_HOME环境变量吗?

推荐答案

您已在应用程序寻找Java 8的同时安装了Java13.因此,请安装Java 8并将其设置为默认的jvm/jre(设置JAVA_HOME).

You've installed java 13 while your application is looking for java 8. So install java 8 and set it your default jvm/jre (set your JAVA_HOME).

希望有帮助!

这篇关于错误:“"无法找到与版本"1.8"匹配的任何JVM.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆