未找到 Android 设备监视器 JDK 路径 [英] Android Device Monitor not found JDK Path
问题描述
我正在使用 Arch Linux 和 Gnome.
I'm using Arch Linux with Gnome.
我通过桌面项打开 Android Studio.代码编辑器工作正常,设备管理器正确启动,应用程序运行得非常好,但是当我尝试打开设备监视器时,出现此错误:
I open Android Studio by the desktop item. The code editor works fine, the device manager starts correctly and the app run like a charm, but when I try to open the Device Monitor, I get this error:
Java 运行时环境 (JRE) 或 Java 开发工具包 (JDK)必须可用才能运行 Monitor.没有Java虚拟机搜索以下位置后找到:/home/grams/Android/Sdk/tools/lib/monitor-x86_64/jre/bin/javajava 在您当前的 PATH 中当我从命令行运行 android studion 时,设备监视器工作.
A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Monitor. No Java virtual machine was found after searching the following locations: /home/grams/Android/Sdk/tools/lib/monitor-x86_64/jre/bin/java java in your current PATH When i run the android studion from command line, the Device Monitor works.
这里是 .desktop 内容
Here is the .desktop content
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=/home/grams/android-studio/bin/studio.png
Name[en_US]=Android Studio
Exec=/home/grams/android-studio/bin/studio.sh
Comment[en_US]=Android Studio IDE
Name=Android Studio
Comment=Android Studio IDE
Icon=/home/grams/android-studio/bin/studio.png
我的 JRE 和 JDK 变量被添加到/etc/profile.当我在命令行上运行 Android Studio 时,不会发生此错误.也许是 Gnome 启动器的问题?
My JRE and JDK variables are being added on /etc/profile. When i run Android Studio on the command line, this error not occurs. Maybe it is a problem with Gnome launcher ?
推荐答案
最新的 Android Studio Bundle 带有自己的 JRE(在
下,这是推荐使用的 JRE(查看文件/项目结构/SDK 位置).
Newest Android Studio Bundle comes with its own JRE (under <ANDROID_STUDIO>/jre
and this is the recommended JRE to work with (look at File / Project Structure / SDK Location).
同样,一个简单的选择是在监控工具下创建一个符号链接,以保持 JRE 与 Android Studio 保持一致,甚至获得更新.
Likewise, a simple option is to create a symbolic link under the monitor tools to keep JRE in line with Android Studio even getting an update.
对于 MAC 或 Linux:
For MAC or Linux:
#ln -s <ANDROID_STUDIO>/jre <SDK>/tools/lib/monitor-x86_64/jre
32 位:
#ln -s <ANDROID_STUDIO>/jre <SDK>/tools/lib/monitor-x86/jre
然后 ddms 监视器适用于两种方式:来自 Studio IDE(工具/Android/ADM)或命令行(<SDK>tools/./monitor
)
Then the ddms monitor works for both ways: from Studio IDE (Tools / Android / ADM) or command line (<SDK>tools/./monitor
)
这篇关于未找到 Android 设备监视器 JDK 路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!