简体   繁体   English

在Ubuntu中设置Android SDK路径的问题

[英]Problem in setting path for android sdk in ubuntu

 export PATH=${/home/mohit/}:<android-sdk-linux_86>/tools

this is what i am using.. 这就是我正在使用的..

error:-- 错误: -

bash: PATH=${/home/mohit/}:: bad substitution

this is the path of sdk 这是SDK的路径

mohit@mohit-laptop:~/android-sdk-linux_86$ pwd
/home/mohit/android-sdk-linux_86

Typically you will use 通常,您将使用

export PATH=${PATH}:<added path here>

try that, to append to your $PATH variable, or just remove the ${} and set it directly, if you wish to replace it. 尝试将其附加到$ PATH变量,或者如果要替换它,只需除去$ {}并直接进行设置即可。 Also keep in mind, this change is not permanent unless you add this to your .bashrc or .bash_profile or equivalent scripts. 还要记住,除非您将此更改添加到.bashrc或.bash_profile或等效脚本中,否则此更改不是永久的。 You can reload them with the 您可以使用

source .bash_profile

command without having to re-login. 命令,而无需重新登录。

The problem is that ${/home/mohit/} is actually treating /home/mohit/ as a variable and attempting to dereference it. 问题在于${/home/mohit/}实际上将/home/mohit/视为变量并尝试取消引用它。 My guess is that what you really wanted to do was: 我的猜测是您真正想做的是:

export PATH="$PATH":"$HOME/android-sdk-linux_86/tools"

You can edit your /etc/profile to add the path you need. 您可以编辑/ etc / profile来添加所需的路径。 Like this: 像这样:

JAVA_HOME=/opt/jdk1.6.0_30
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export JAVA_HOME
export CLASSPATH
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin

It is global. 它是全球性的。

您可以在/etc/profile.d/下维护一个脚本文件,我们可以将其用作全局文件。

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

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