【问题标题】:Linux Redhat .bash_profile does not workLinux Redhat .bash_profile 不起作用
【发布时间】:2014-08-28 02:35:49
【问题描述】:

我修改了我的 .bash_profile 如下:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_HOME
export PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_SID=XE

JAVA_HOME=/home/oracle/softs/jdk1.7.0_25
export JAVA_HOME

export PATH=$PATH:$JAVA_HOME/bin

但是echo $PATH 命令的输出并不如我所愿:

/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin

当然,我不能使用 Java 命令。请帮忙。

【问题讨论】:

    标签: java linux .bash-profile


    【解决方案1】:

    您是否重新加载了您的环境? .bash_profile 只有在您登录时才会重新读取。

    尝试资源化 .bash_profile:

    $ . ~/.bash_profile
    

    或者

    $ source ~/.bash_profile
    

    或者只是注销并重新登录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-08-23
      • 2020-11-28
      • 1970-01-01
      • 2023-03-30
      • 2015-05-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多