ubuntu中android sdk设置路径问题

发布于 2024-08-28 14:24:57 字数 317 浏览 3 评论 0原文

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

这就是我正在使用的..

错误:--

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

这是sdk的路径

mohit@mohit-laptop:~/android-sdk-linux_86$ pwd
/home/mohit/android-sdk-linux_86
 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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

夏花。依旧 2024-09-04 14:24:57

通常,您将使用

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

try that 附加到 $PATH 变量,或者如果您想替换它,则删除 ${} 并直接设置它。另请记住,除非您将其添加到 .bashrc 或 .bash_profile 或等效脚本中,否则此更改不是永久性的。您可以使用

source .bash_profile

命令重新加载它们,而无需重新登录。

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. Also keep in mind, this change is not permanent unless you add this to your .bashrc or .bash_profile or equivalent scripts. You can reload them with the

source .bash_profile

command without having to re-login.

十二 2024-09-04 14:24:57

问题在于 ${/home/mohit/} 实际上将 /home/mohit/ 视为变量并尝试取消引用它。我的猜测是你真正想做的是:

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

The problem is that ${/home/mohit/} is actually treating /home/mohit/ as a variable and attempting to dereference it. My guess is that what you really wanted to do was:

export PATH="$PATH":"$HOME/android-sdk-linux_86/tools"
冰之心 2024-09-04 14:24:57

您可以编辑 /etc/profile 以添加您需要的路径。
就像这样:

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

它是全球性的。

You can edit your /etc/profile to add the path you need.
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.

甜妞爱困 2024-09-04 14:24:57

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

You can maintain a script file under /etc/profile.d/ and we can use it as global

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文