相关疑难解决方法(0)

通过更新 ~/.profile 添加自定义路径但不起作用

我通过添加以下内容更改了我的 ~/.profile 文件:

PATH="/user/share/android-sdk-linux/tools:$PATH"
Run Code Online (Sandbox Code Playgroud)

然后我注销并再次登录,但路径没有添加到 $PATH 环境变量中。我正在检查终端:

echo $PATH
/usr/share/android-sdk-linux/tools:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/jdk1.7.0_17/bin
Run Code Online (Sandbox Code Playgroud)

请指教

编辑

我什至尝试过:

PATH=$PATH:/usr/share/android-sdk-linux/tools
EXPORT PATH
Run Code Online (Sandbox Code Playgroud)

这里也没有运气。

编辑 2

~/.profile:

 # ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package. …
Run Code Online (Sandbox Code Playgroud)

user-profile environment-variables

16
推荐指数
2
解决办法
4万
查看次数