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
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With