简体   繁体   中英

Android Studio AVD not detecting JRE

I am running Ubuntu 14.10.
I recently installed Android Studio on my laptop.
When I try to run the AVD, I get the following error
错误

When I try java -version in the terminal, it shows I have JDK and JRE installed. 终奌站

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. You have to just concatenate (using ':' operator) the JAVA_HOME/bin directory in your /etc/environment file like this -

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.

Note: export is invalid in /etc/environment since it is not a shell/bash file. /etc/environment/ is just a configuration file which is read by the OS during boot and all setting is loaded in that time. And finally the configuration written int /etc/environment will be applicable for all over the environment and for all users.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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