简体   繁体   English

Linux Ubuntu Android SDK管理器无法启动 - android:java:找不到

[英]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". 我将android SDK解压缩到一个名为“/ usr / android / android-sdk-linux”的文件夹中。 I go into "tools/" and double click the executable file "android", click "Run in Terminal" but nothing happens. 我进入“工具/”并双击可执行文件“android”,单击“在终端中运行”但没有任何反应。 I also click "Run" but again nothing happens. 我也点击“运行”,但没有任何反应。 i run it in terminal ( ./android command), and i get: 我在终端( ./android命令)中运行它,我得到:

./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 编辑:以下是~$ 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 . 我所要做的就是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. 当您使用基于Debian的Linux发行版时,如果您手动(而不是从存储库)安装JDK,更好的解决方案是创建一个指向java命令的符号链接。

I solved this problem. 我解决了这个问题。 Create a symbolik link named /usr/bin/java dan point it to /home/your_name/your_jdk_folder/bin/java 创建一个名为/ usr / bin / java dan的symbolik链接指向/ home / your_name / your_jdk_folder / bin / java

This is the sample command in terminal/konsol 这是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: 在/ opt / jdk中使用Ubuntu 14.04和Sun JDK 1.8我解决了这个问题:

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. 这使用了Ubuntu也使用的基于Debian的替代系统。 Please note that this is in the case that you don't have any other Java (ie OpenJDK) installed. 请注意,如果您没有安装任何其他Java(即OpenJDK)。 If you have another Java installed, chances are you already have an alternative installed for it. 如果您安装了另一个Java,则可能已经安装了替代Java。 Consult the update-alternatives man page to see how the system works. 请参阅update-alternatives手册页以了解系统的工作原理。

It looks like you don't have java installed. 看起来你没有安装java。 Try just running java - is that not found? 尝试只运行java - 是不是找不到?

确保安装了特别的Java6 JDK

I was using android studio on ubuntu 14.04, 64bit and this error was caused due to the file permission issues in $home/android-studio/sdk/tools 我在ubuntu 14.04,64bit上使用android studio,这个错误是由$home/android-studio/sdk/tools的文件权限问题引起的

$sudo chmod -R 755 ./*

Running the command in $home/android-studio/sdk/tools solved the problem. $home/android-studio/sdk/tools运行命令解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM