Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Ubuntu Android SDK manager not starting up - android:java: not found

I extracted the android SDK into a folder i made called "/usr/android/android-sdk-linux". I go into "tools/" and double click the executable file "android", click "Run in Terminal" but nothing happens. I also click "Run" but again nothing happens. i run it in terminal (./android command), and i get:

./android: 1: ./android: java: not found
./android: 1: ./android: java: not found
./android: 110: exec: java: not found

So why is this happening?

Edit: Here are the results of ~$ java

* default-jre
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
* gcj-4.5-jre-headless
* openjdk-7-jre-headless
like image 697
Geore Shg Avatar asked Jul 11 '12 21:07

Geore Shg


3 Answers

All i had to do was sudo apt-get install openjdk-7-jdk. Never trying a manual installation again. oh and sorry for my ignorance on the previous answers.

like image 104
Geore Shg Avatar answered Nov 14 '22 11:11

Geore Shg


when you are using Debian based Linux Distribution, the better solution if you install JDK manually (not from repository) is by make a symbolic link that point to a java command.

I solved this problem. Create a symbolik link named /usr/bin/java dan point it to /home/your_name/your_jdk_folder/bin/java

This is the sample command in terminal/konsol

sudo ln -s /home/azware/tmp/jdk1.7.0_03/bin/java /usr/bin/java
like image 15
azwar_akbar Avatar answered Nov 14 '22 11:11

azwar_akbar


Using Ubuntu 14.04 with Sun JDK 1.8 in /opt/jdk I solved this problem with this:

sudo update-alternatives --install /usr/local/bin/java java /opt/jdk/bin/java 0
sudo update-alternatives --install /usr/local/bin/javac javac /opt/jdk/bin/javac 0

This uses the Debian-based alternatives system that Ubuntu also uses. Please note that this is in the case that you don't have any other Java (i.e. OpenJDK) installed. If you have another Java installed, chances are you already have an alternative installed for it. Consult the update-alternatives man page to see how the system works.

like image 3
jecolon Avatar answered Nov 14 '22 11:11

jecolon