简体   繁体   English

Android Studio AVD未检测到JRE

[英]Android Studio AVD not detecting JRE

I am running Ubuntu 14.10. 我正在运行Ubuntu 14.10。
I recently installed Android Studio on my laptop. 我最近在笔记本电脑上安装了Android Studio。
When I try to run the AVD, I get the following error 当我尝试运行AVD时,出现以下错误
错误

When I try java -version in the terminal, it shows I have JDK and JRE installed. 当我在终端中尝试java -version时,它表明我已经安装了JDK和JRE。 终奌站

This is the path I've specified 这是我指定的路径 候机楼

I've tried changing the path but no luck. 我试图改变道路,但没有运气。 Please help. 请帮忙。

Since it is not a shell script you can not write any shell variable with '$' sign. 由于它不是shell脚本,因此您不能编写任何带有“ $”符号的shell变量。 You have to just concatenate (using ':' operator) the JAVA_HOME/bin directory in your /etc/environment file like this - 您只需像这样在/etc/environment文件中串联(使用':'运算符) JAVA_HOME/bin目录-

JAVA_HOME=/user/local/jdk1.8.0_45
PATH="/usr/local/bin:/usr/sbin:/usr/bin:/user/local/jdk1.8.0_45/bin"

export JAVA_HOME #invalid in /etc/environment; don't place export here
export PATH #invalid in /etc/environment; don't place export here  

From in /etc/environment you don't need to export the environment variables. /etc/environment您不需要导出环境变量。

Note: export is invalid in /etc/environment since it is not a shell/bash file. 注意:/etc/environment导出无效,因为它不是shell / bash文件。 /etc/environment/ is just a configuration file which is read by the OS during boot and all setting is loaded in that time. /etc/environment/只是一个配置文件,在启动过程中OS会读取它,并且所有设置都会在该时间加载。 And finally the configuration written int /etc/environment will be applicable for all over the environment and for all users. 最后,以int /etc/environment编写的配置将适用于整个环境以及所有用户。

我建议您从Ubuntu软件中心安装Open JDK,然后无需执行任何路径操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM