在Linux上运行Android工作室的一个问题
我最近安装的Android工作室Manjaro的Linux,但我每一次我都跑从从头开始应用遇到的问题。也就是说,为了启动应用程序,我必须以root身份登录,然后我要验证JAVA_HOME环境变量,最后开始./studio.sh应用
I have recently installed Android Studio on Manjaro Linux, but I am experiencing issues every time I have to run the application from the scratch. Namely, in order to start application, I have to be logged in as root, then I have to validate JAVA_HOME environmental variable and finally start the application with ./studio.sh
下面是,充分code:
Here is the full code of that:
[nikodroid@manjaro ~]$ cd /usr/share/applications/android-studio/bin
bash: cd: /usr/share/applications/android-studio/bin: Permission denied
[nikodroid@manjaro ~]$ sudo su
[sudo] password for nikodroid:
[root@manjaro nikodroid]# cd /usr/share/applications/android-studio/bin
[root@manjaro bin]# ./studio.sh
which: no java in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/vendor_perl:/usr/bin/core_perl)
ERROR: Cannot start Android Studio\nNo JDK found. Please validate either STUDIO_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
[root@manjaro bin]# cd /usr/java/
[root@manjaro java]# export JAVA_HOME=/usr/java/jdk1.7.0_21/
[root@manjaro java]# export PATH=$PATH:$JAVA_HOME/bin
[root@manjaro java]# cd /usr/share/applications/android-studio/bin/
[root@manjaro bin]# ./studio.sh
所以,很显然这种只运行时,我保持终端会话,一旦我退出,应用程序将停止工作。我的问题是,我该怎么做才能这一切我每次要运行的应用程序不能做?
So, obviously this runs only when I am keeping the terminal session, once I exit, the application stops working. My question is, what can I do in order to not do this all every time I want to run the application?
刚提,我把下面的行
JAVA_HOME=/usr/java/jdk1.7.0_21/
在/ etc /环境/为了坚持这个环境变量,但似乎没有奏效。
in /etc/environment/ in order to persist this environment variable, but it seems that it didn't work.
谢谢!
这的确是一个权限问题,我看了一下,发现原来的所有者和组搞砸了,所以我所做的是改变权限/所有权与
It really was a permission issue, as I looked and found out that the owner and group were messed up, so what I did is changing the permission/ownership with:
chown -R root:root android-studio
在此,我只是改变了DIR用:
After this, I just changed the dir with:
cd /usr/share/applications/android-studio/bin
和运行
./studio.sh
它加载的应用程序没有任何错误。
It loaded the application without any errors.