简体   繁体   English

Linux Redhat .bash_profile不起作用

[英]Linux Redhat .bash_profile does not work

I modified my .bash_profile as follow: 我将我的.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

But the output of echo $PATH command is not as my expect: 但是echo $PATH命令的输出不符合我的预期:

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

Of course, I cannot use Java commands. 当然,我不能使用Java命令。 Please help. 请帮忙。

Did you reload your environment? 您是否重新加载了环境? .bash_profile is only re-read when you login. .bash_profile仅在您登录时重新读取。

Try resourcing .bash_profile: 尝试资源.bash_profile:

$ . ~/.bash_profile

Or 要么

$ source ~/.bash_profile

Or just log out and log in again. 或者只是注销并再次登录。

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

相关问题 java.io.IOException:没有用于scheme的FileSystem:maprfs。 将maprfs jar添加到bash_profile无效 - java.io.IOException: No FileSystem for scheme: maprfs. Adding the maprfs jar to bash_profile didn't work 如何在.bash_profile中设置JAVA_TOOL_OPTIONS? - How to set JAVA_TOOL_OPTIONS in .bash_profile? 登录时 ~/bash_profile 中的 $JAVA_HOME 路径来源不正确 - $JAVA_HOME path not sourced correctly in ~/bash_profile at login .bash_profile无法操作,更新路径无法解决问题 - .bash_profile inoperable, updating path doesn't resolve the issue Maven无法识别在bash_profile中设置的JAVA_HOME - Maven not recognizing JAVA_HOME being set in bash_profile 如何在 Mac 上将 Java 路径添加为环境变量 bash_profile - How to add the Java Path as an environment variable bash_profile on Mac 在.bash_profile 中设置 JAVA_HOME 不返回正确的路径 - Setting JAVA_HOME in .bash_profile not returning correct path System.getenv 没有得到 ~/.bash_profile 中定义的变量 - System.getenv doesn't get variables defined in ~/.bash_profile TelnetClient (Apache Commons Net 3.7.2 API) 已连接 solaris10 但无法加载 ~/.bash_profile - TelnetClient (Apache Commons Net 3.7.2 API) connected solaris10 but can not load ~/.bash_profile 我想在Mac上安装Java JDK 8,但是.bash_profile无法检测到JAVA_HOME - I want to install Java JDK 8 on mac, but .bash_profile won't detect JAVA_HOME
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM