1

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.

1 Answer 1

1

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 
Sign up to request clarification or add additional context in comments.

5 Comments

Thanks for answering, but I'v already set the environment. Now if I list the available JVM the output is:java-8-oracle 1 /usr/lib/jvm/java-8-oracle, is that right?
@Eguil I get java-8-oracle 1079 /usr/lib/jvm/java-8-oracle. Anyway, the error exec: /usr/lib/jvm/java-8-oracle: Permission denied is pretty clear. And if you run file /usr/lib/jvm/java-8-oracle you'll see why it can't exec it.
It returned /usr/lib/jvm/java-8-oracle: directory, just shows it's a directory...but if I ls -l it, output is -rwxrwxrwx 1 eguil eguil 3520 July 30 09:55 /home/eguil/android/sdk/tools/android, it shows that it's all can read write and execute, isn't it?
@Eguil And how would you execute a directory? Your environment variables aren't set correctly.
Oh, you remind me... I only thought it was something about the permission issue, it's solved, thanks a lot!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.