即使 JRE 8 安装在我的 MAC 上 - “没有 Java 运行时存在,请求安装”会显示在终端中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44009058/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Even though JRE 8 is installed on my MAC -" No Java Runtime present,requesting to install " gets displayed in terminal
提问by Gina Gina
Even though JRE 8 is installed on my MAC OS Yosemite 10.10.3,while running the Android present in tools in sdk - the error - " No Java Runtime present,requesting to install " gets displayed in terminal- how do i solve this issue?
尽管 JRE 8 安装在我的 MAC OS Yosemite 10.10.3 上,但在 sdk 中的工具中运行 Android 时 - 错误 - “没有 Java 运行时存在,请求安装”会显示在终端中 - 我该如何解决这个问题?
I wanted to install Xamarin test recorder - after installing they asked me to install Android sdk
SDK is downloaded in Library/Developer/Xamarin/android-sdk
Now when I run Android present in tools folder - I get the error - No Java run time
I've installed JRE 8 with get the verified java version from their site
我想安装 Xamarin 测试记录器 - 安装后他们要求我安装 Android sdk
SDK下载在Library/Developer/Xamarin/android-sdk
现在,当我在工具文件夹中运行 Android 时 - 我收到错误 - 没有 Java 运行时间
我已经安装了 JRE 8,并从他们的网站上获取了经过验证的 Java 版本
Can someone please help!!
有人可以帮忙吗!!
采纳答案by MrDEV
回答by abalos
Since it sounds like your JAVA_HOME variable is not set correctly, follow the instructions for setting that.
由于听起来您的 JAVA_HOME 变量设置不正确,请按照说明进行设置。
Setting JAVA_HOME environment variable on MAC OSX 10.9
在 MAC OSX 10.9 上设置 JAVA_HOME 环境变量
I would imagine once you set this, it will stop complaining.
我想一旦你设置了这个,它就会停止抱怨。
回答by MrDEV
In newer versions of OS X (especially Yosemite, EL Capitan), Apple has removed Java support for security reasons. To fix this you have to do the following.
在较新版本的 OS X(尤其是 Yosemite、EL Capitan)中,出于安全原因,Apple 已取消对 Java 的支持。要解决此问题,您必须执行以下操作。
- Download Java for OS X 2015-001 from this link: https://support.apple.com/kb/dl1572?locale=en_US
Mount the disk image file and install Java 6 runtime for OS X.
After this you should not be seeing any of the below messages:
- Unable to find any JVMs matching version "(null)"
- No Java runtime present, try --request to install.
- 从此链接下载适用于 OS X 2015-001 的 Java:https: //support.apple.com/kb/dl1572?locale =en_US
挂载磁盘映像文件并为 OS X 安装 Java 6 运行时。
在此之后,您不应看到以下任何消息:
- 无法找到任何与版本“(null)”匹配的 JVM
- 不存在 Java 运行时,请尝试 --request 安装。
回答by Oleg Kazakov
I didn't need the full JDK, I just needed to make JRE work and none of the other answers provided above worked for me. Maybe it used to work, but now (1st Jul 2018) it isn't working. I just kept getting the error and the pop-up.
我不需要完整的 JDK,我只需要让 JRE 工作,上面提供的其他答案都不适合我。也许它曾经有效,但现在(2018 年 7 月 1 日)它不起作用。我只是不断收到错误和弹出窗口。
I eventually solved this issue by placing the following JAVA_HOME export in ~/.bash_profile:
我最终通过在 ~/.bash_profile 中放置以下 JAVA_HOME 导出解决了这个问题:
export JAVA_HOME=/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
Hope this helps someone. I'm running Mac OS High Sierra.
希望这可以帮助某人。我正在运行 Mac OS High Sierra。
回答by atereshkov
If you came across the error when tried to generate a jks file (keystore), so try adding
如果您在尝试生成 jks 文件(密钥库)时遇到错误,请尝试添加
/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool
before running the command, like so:
在运行命令之前,像这样:
/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home/bin/keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
回答by kallayya Hiremath
install JDK it will work ,
安装JDK它会工作,
here is the jdk link to download .
这是下载的jdk链接。
link: https://www.oracle.com/technetwork/java/javase/downloads/jdk13-downloads-5672538.html
链接:https://www.oracle.com/technetwork/java/javase/downloads/jdk13-downloads-5672538.html
回答by emr
Below is worked for me on macos mojave 10.14.6 version
以下适用于 macos mojave 10.14.6 版本
I installed current jdk(https://www.oracle.com/java/technologies/javase-downloads.html)
我安装了当前的 jdk( https://www.oracle.com/java/technologies/javase-downloads.html)
Then do respectively;
然后分别做;
- vim .bash_profile
- add "export JAVA_HOME=$(/usr/libexec/java_home)" to bash_profile
- source .bash_profile
- vim .bash_profile
- 将“export JAVA_HOME=$(/usr/libexec/java_home)”添加到bash_profile
- 源 .bash_profile
it is done. And you can check the version with java -version command.
它完成了。您可以使用 java -version 命令检查版本。