4

I just installed Android Studio, but I can only start it with root permissions: sudo ./studio.sh otherwise it fails with Error: Could not find or load main class com.intellij.idea.Main

I am not sure where to start investigating the file permissions, any ideas?

Some info:

enter image description here

d@d-Aspire-M5-581TG /opt/android-studio/bin $ cat /etc/*-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17.1
DISTRIB_CODENAME=rebecca
DISTRIB_DESCRIPTION="Linux Mint 17.1 Rebecca"
NAME="Ubuntu"
VERSION="14.04.1 LTS, Trusty Tahr"
...

d@d-Aspire-M5-581TG ~ $ java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

Update: I created a desktop bookmark and with that it launches ok, so it's not an issue anymore. Yet, It would be great to know why it doesn't work when I try it from the terminal.

Crocodile
  • 173
  • 2
  • 3
  • 9

4 Answers4

1

After starting Android studio with sudo, select Tools - Create Desktop Entry.

This will create an icon for Android studio and if you do a search in the dash, it will pop up in-between the other applications.

Fabby
  • 34,259
0

what I did is:

  1. sudo mousepad: to create a root owned shell file to launch it as root from GUI
  2. save a .sh file with this command: gksudo android-studio for instance save it in /home/YOUR_USER/studio.sh
  3. sudo chmod 775 /home/luca/studio.sh: allow execution of it
  4. settings -> menu edit add an entry in the menu, with the command: /home/YOUR_USER/studio.sh

done.

the advantage is that it didn't open a terminal to work an is very simple

Luca C.
  • 101
0

I downloaded Android Studio, too, and for me, every single file in /bin belongs to me and not to root. Maybe try changing that with chown and run it again.

octavian
  • 180
0

The file /opt/android-studio/lib/bootstrap.jar has the wrong permissions.

Fix this with the following command:

sudo chmod g+r,o+r /opt/android-studio/lib/bootstrap.jar

The above will give read attributes to "group" and "other". Now you can use Android Studio as a normal user. Unless there are other incorrect permissions.

Fabby
  • 34,259
A.B.
  • 90,397