小编Geo*_*e D的帖子

环境变量似乎已设置但不起作用

我将 Ubuntu 14.10 与 bash shell 一起使用。

我下载了一个gradle发行版并将其移动到一个新目录。我想永久设置一个环境变量来指向bingradle 文件夹的子目录。

我已经编辑~/.bashrc~./profile根据建议包含了 gradle 运行脚本的路径。然而,当我输入gradle(这是 bin 文件夹中脚本的名称)时,它不会运行。注销,重新启动和一切,但它仍然不起作用。

有什么我在这里想念的吗?

  1. 在末尾添加了这一行 .bashrc

    导出 GRADLE=/home/sanctus/Documents/Development/gradle-2.2/bin

  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 …
    Run Code Online (Sandbox Code Playgroud)

command-line bash scripts environment-variables bashrc

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