Eguil
Eguil

Reputation: 13

Permission denied when launching android SDK manager on ubuntu even with root authority

I'm new to ubuntu, and want to develop android apps with eclipse (because I heard that the android studio can't work very well with NDK stuff yet).

First I installed java-8-oracle with apt-get, it was automatically installed under/usr/lib/jvm/java-8-oracle, then I set the environment variables, and executed java -version to test if is well installed, everything was fine I even wrote a HelloWorld in java using gedit and ran it in command line ,so there should be nothing wrong with the JDK I think.

But after I installed the eclipse and sdk (extracted frome adt-bundle-linux-x86_64-20140702.zip I download), when I opened the eclipse and tried to launch the SDK manager, the problem came like this (eguil is my username):

[2015-07-30 10:09:48 - SDK Manager] [SDK Manager] /home/eguil/android/sdk/tools/android: 1: /home/eguil/android/sdk/tools/android: /usr/lib/jvm/java-8-oracle: Permission denied
[2015-07-30 10:09:48 - SDK Manager] [SDK Manager] /home/eguil/android/sdk/tools/android: 1: /home/eguil/android/sdk/tools/android: /usr/lib/jvm/java-8-oracle: Permission denied
[2015-07-30 10:09:48 - SDK Manager] [SDK Manager] /home/eguil/android/sdk/tools/android: 110: exec: /usr/lib/jvm/java-8-oracle: Permission denied

Then I executed the command

sudo chmod -R 777 /home/eguil/android(where the eclipse and SDK are installed)

and

sudo chmod -R 777 /usr/lib/jvm/java-8-oracle

I assumed that I should never have any "permission problems" from now, but I was wrong, the problem still exists. I'v also tried launching the SDK manager in commond line sudo ./home/eguil/android/sdk/tools/android, but the output was the same.

Could anyone tell me the reason and how to solve the problem? I'll be appreciated, It's driving me crazy.

Upvotes: 1

Views: 1097

Answers (1)

Elliott Frisch
Elliott Frisch

Reputation: 201439

That isn't how you set the Java environment in ubuntu. Use

update-java-alternatives -s java-8-oracle

And you can list JVM(s) available with

update-java-alternatives -l

Upvotes: 1

Related Questions