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

有人能帮帮我吗!!


当前回答

我不需要完整的JDK,我只需要让JRE工作,上面提供的其他答案都不适合我。 也许它曾经起作用,但现在(2018年7月1日)不起作用了。我一直得到错误和弹出窗口。

我最终通过在~/.bash_profile中放置以下JAVA_HOME导出来解决这个问题:

export JAVA_HOME=/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

希望这能帮助到一些人。 我运行的是Mac OS High Sierra。

其他回答

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

cd ~

brew install openjdk

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

source .bash_profile

如果你和我有同样的问题,我可以告诉你为什么会发生这种情况。我只是还不知道该怎么解决。

下面就是:

我在MacOS Big Sur上使用的是JDK 1.8版本。我不想安装更高版本的JDK,因为我所有的项目都运行在1.8上。但事情是这样的....在命令行中

java -version

返回:

openjdk version "1.8.0_302"
OpenJDK Runtime Environment (build 1.8.0_302-bre_2021_08_14_21_34-b00)
OpenJDK 64-Bit Server VM (build 25.302-b00, mixed mode)

但是一个稍有不同的命令(版本前缀是2个破折号而不是1)

java --version

返回以下错误:

Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

这是因为Java 8使用单破折号版本,之后的所有jdk都使用双破折号。

因此,当查找JAVA_HOME时,机器也使用双破折号并得到错误。

安装JDK就可以了,

这里是JDK的下载链接。

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

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.

我不需要完整的JDK,我只需要让JRE工作,上面提供的其他答案都不适合我。 也许它曾经起作用,但现在(2018年7月1日)不起作用了。我一直得到错误和弹出窗口。

我最终通过在~/.bash_profile中放置以下JAVA_HOME导出来解决这个问题:

export JAVA_HOME=/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

希望这能帮助到一些人。 我运行的是Mac OS High Sierra。