[英]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.