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

有人能帮帮我吗!!


当前回答

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


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

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

其他回答

如果在尝试生成jks文件(密钥库)时遇到错误,那么尝试添加

/Applications/Android\ Studio.app/Contents/jre/Contents/Home/bin/keytool

在运行命令之前,像这样:

/Applications/Android\ Studio.app/Contents/jre/Contents/Home/bin/keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

Pre-Requisite:

我已经在我的机器上使用brew安装了java11。

步骤1:酿造信息java11

输出:

/选择/自制/酒窖/openjdk@11

USER1-MacBook-Pro JavaVirtualMachines % brew info java11
openjdk@11: stable 11.0.12 (bottled) [keg-only]
Development kit for the Java programming language
https://openjdk.java.net/
/opt/homebrew/Cellar/openjdk@11/11.0.12 (670 files, 273.0MB)
  Poured from bottle on 2021-10-09 at 13:07:04
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openjdk@11.rb
License: GPL-2.0-only
==> Dependencies
Build: autoconf ✔
==> Requirements
Build: Xcode ✘
==> Caveats
For the system Java wrappers to find this JDK, symlink it with
  sudo ln -sfn /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk

openjdk@11 is keg-only, which means it was not symlinked into /opt/homebrew,
because this is an alternate version of another formula.

If you need to have openjdk@11 first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc

For compilers to find openjdk@11 you may need to set:
  export CPPFLAGS="-I/opt/homebrew/opt/openjdk@11/include"

==> Analytics
install: 44,188 (30 days), 149,578 (90 days), 433,845 (365 days)
install-on-request: 19,074 (30 days), 63,262 (90 days), 187,286 (365 days)
build-error: 0 (30 days)

步骤2:将openJDK路径附加到现有路径。

echo 'export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc . bin:$PATH

步骤3:源现有shell或打开新终端以验证更改

来源 ~/.zshrc

步骤4:添加检查路径

而java

输出:/ opt /自制/ opt / openjdk@11 / bin / java

步骤5:

java——版本

openjdk 11.0.12 2021-07-20
OpenJDK Runtime Environment Homebrew (build 11.0.12+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.12+0, mixed mode)

下面是在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命令查看版本。

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.

通过以下命令工作

export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home"