即使JRE 8安装在我的MAC OS Yosemite 10.10.3,而运行Android目前的工具在sdk -错误-“没有Java运行时目前,请求安装”会显示在终端-我如何解决这个问题?

我想安装Xamarin测试记录器-安装后 让我安装Android sdk SDK下载路径:Library/Developer/Xamarin/android-sdk 现在当我在工具文件夹中运行Android时,我得到了错误 没有Java运行时 我已经安装了JRE 8,并得到了验证 Java版本从他们的网站

有人能帮帮我吗!!


当前回答

也许有人仍然有同样的问题。你可以使用homebrew安装openjdk,然后将新的JDK bin目录添加到你的路径前面:

cd ~

brew install openjdk

echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> .bash_profile

source .bash_profile

其他回答

也许有人仍然有同样的问题。你可以使用homebrew安装openjdk,然后将新的JDK bin目录添加到你的路径前面:

cd ~

brew install openjdk

echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> .bash_profile

source .bash_profile

It's worth noting that with my current version of SQLDeveloper (21.2.1), there's another way to specify the JDK location. In my case, I was able to open up ~/.sqldeveloper/21.2.1/product.conf and set the JavaHome directive to the appropriate directory. I use jabba for JDK version management, and this path was something like ~/.jabba/jdk/amazon-corretto@1.8.292-10.1/Contents/Home. Needless to say, just setting that config value and restarting SQLDeveloper left me with a running copy again. This should work with any version of SQLDeveloper given the product.conf file exists inside your user's .sqldeveloper directory appropriate for the version you are using.

在OS X的新版本(特别是Yosemite, EL Capitan)中,苹果出于安全原因已经删除了Java支持。 要解决这个问题,您必须执行以下操作。

从此链接下载Java for OS X 2015-001: https://support.apple.com/kb/dl1572?locale=en_US 挂载磁盘镜像文件,安装适用于OS X的Java 6运行时。 在此之后,您应该不会看到以下任何消息: -无法找到任何匹配版本的jvm "(null)" -没有Java运行时,尝试——request安装。 这将解决如下所示的弹出窗口的问题:

在2022年,只有安装了Android工作室:

检查Android studio中是否安装JDK。在Android Studio中,选择文件>项目结构。在SDK条目下,如果没有选择默认JDK,则从列表中选择,如果没有,则添加JDK,然后申请安装。 在Android studio中安装JDK后,只需直接从Android studio中添加JDK路径即可。在终端中运行下面的命令,就完成了。

echo 'export JAVA_HOME="/应用程序/Android Studio. home ="app/Contents/jre/Contents/Home"' >> ~/.zshrc . Home

现在,检查它是否工作。

❯Java -version Openjdk版本“11.0.11”2021-04-20 OpenJDK运行时环境(build 11.0.11+0-b60-7772763) OpenJDK 64位服务器虚拟机(build 11.0.11+0-b60-7772763,混合模式)

不需要从brew安装任何包或创建任何符号链接。Java已经嵌入到Android工作室中,我们可以直接在我们的系统中使用它。

2022年:

一旦安装了Android Studio,就不需要再下载Java了。

尽管Java 11现在已经嵌入到Android Studio中,但在Mac上有时会出现这个问题,无法找到Java运行时。

所以,我通过以下两步解决了这个问题:

In Android Studio go to File > Project Structure. If, under the SDK entry, you can see there is no default SDK selected, but a text in red "No SDK", click on it and you will find an SDK / JDK list, select one of them. Thats it. Make sure you run Android Studio from Application Folder. For this copy the Android Studio launcher to the Application folder. Then in the Finder, go to the Application folder. Right-click on it. Click on "Show package contents", then navigate up to jre folder. Copy the folder and paste it into your home folder.

现在在终端上设置路径:你可以创建一个名为java_jre的文件夹,路径必须设置为jre/contents/Home:

Noors-Mac-mini:bin noorhossain$ export JAVA_HOME="/Users/noorhossain/java_jre/jre/Contents/Home"

//现在检查版本:

Noors-Mac-mini:bin noorhossain$ java -version

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
OpenJDK 64-Bit Server VM (build 11.0.11+0-b60-7772763, mixed mode)