即使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版本从他们的网站

有人能帮帮我吗!!


当前回答

下面是在macos mojave 10.14.6版本上为我工作的

我安装了当前的jdk(https://www.oracle.com/java/technologies/javase-downloads.html)

然后分别做;

vim . bash_profile 在bash_profile中添加export JAVA_HOME=$(/usr/libexec/ JAVA_HOME 源. bash_profile

完成了。可以使用java -version命令查看版本。

其他回答

安装JDK就可以了,

这里是JDK的下载链接。

链接:https://www.oracle.com/technetwork/java/javase/downloads/jdk13-downloads- html 5672538.

在使用brew安装openjdk并运行brew info openjdk后,我得到了这个


从那里我得到了这个命令,在运行它之后,我得到了Java工作

-操作系统?jdk / Library / Java / JavaVirtualMachines openjdk jdk。

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.

我通过使用brew安装oracle-sdk解决了这个问题。

brew install oracle-jdk --cask

博士TL;

对于JDK 11,请尝试以下方法:

为了干净利落地处理这个问题,我建议使用brew和jenv。

对于Java 11,请遵循以下2个步骤:

JAVA_VERSION=11
brew reinstall jenv 
brew reinstall openjdk@${JAVA_VERSION}
jenv add /usr/local/opt/openjdk@${JAVA_VERSION}/
jenv global ${JAVA_VERSION}

并将此添加到shell配置脚本的末尾~/。Bashrc或~/.zshrc

export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
export JAVA_HOME="$HOME/.jenv/versions/`jenv version-name`"

问题解决了!

然后重新启动shell并尝试执行java -version

注意:如果您遇到此问题,说明您当前的JDK版本不存在或配置错误(或者您只有JRE)。