Problem with Android Studio running on Linux

I recently installed Android Studio on Manjaro Linux, but every time I have to start the application from scratch, I have problems. Namely, in order to start the application, I must be registered as root, then I need to check the JAVA_HOME environment variable and finally start the application with. /studio.sh

Here is the complete code for this:

[ 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 

Thus, it is obvious that this is only done when I have a terminal session, as soon as I exit, the application stops working. My question is: what can I do to not do this every time I want to run the application?

Just to mention, I put the following line

 JAVA_HOME=/usr/java/jdk1.7.0_21/ 

in / etc / environment / to save this environment variable, but it seems to not work.

Thanks!

+6
source share
4 answers

This is really a permission issue, as I looked and found out that the owner and group were corrupted, so I changed the permission / ownership with:

 chown -R root:root android-studio 

After that, I just changed the directory:

 cd /usr/share/applications/android-studio/bin 

and ran

 ./studio.sh 

He downloaded the application without any errors.

+9
source

install JRE and JDK using apt

for JRE: sudo apt-get install default-jre for JDK: sudo apt-get install default-jdk

check if everything is ok: java -version

then continue installing Android Studio

+3
source

A similar problem was solved (but on Windows)

adding the JDK_HOME system variable with the value c: \ Program Files \ Java \ jdk1.7.0_21 \

So try adding:

JDK_HOME = / USR / Java / jdk1.7.0_21 /

for your / etc / environment (and also for saving JAVA_HOME).


UPDATE:

Try setting permissions for "/ usr / share / applications / android-studio / bin" and "./studio.sh".

+1
source

Make sure the content

 /usr/share/applications/android-studio/bin 

are executable (also directory) group . (probably the users group). Then make sure your user is in this group.

0
source

Source: https://habr.com/ru/post/945337/


All Articles