路径未设置为设置

路径未设置为设置

我无法添加我的omnet bin directory安装路径。

在安装过程中,我进入 omnet 目录并输入./configure,结果出现以下错误

WARNING: your PATH doesn't contain /home/ABC/Desktop/omnetpp-4.1/bin!
Add the following line to your .profile or .bash_profile (provided you use bash):
export PATH=$PATH:/home/ABC/Desktop/omnetpp-4.1/bin


WARNING: The TCL_LIBRARY environment variable is not set, and without it
Tkenv (the GUI runtime environment) may be unable to find the BLT library.

Add the following line to your .profile or .bash_profile (provided you use bash):
export TCL_LIBRARY=/usr/share/tcltk/tcl8.4

所以我做了同样的事情...转到配置文件 ~/.profile,它现在看起来像这样

# if running bash
if [ -n "$BASH_VERSION" ]; then
     # include .bashrc if it exists
     if [ -f "$HOME/.bashrc" ]; then
     . "$HOME/.bashrc"
     fi
fi

# set PATH so it includes user's private bin if it exists
export PATH=$PATH:/home/ABC/Desktop/omnetpp-4.1/bin
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
    export TCL_LIBRARY=/usr/share/tcltk/tcl8.4

fi

但错误仍然存​​在。我做错了什么?

答案1

确保您已重新登录(更改仅在您启动新 shell 时发生)。此外,请尝试使用.bash_profile而不是.profile。若要在不重新登录的情况下进行测试,您可以直接输入以下代码来获取文件:

. ~/.profile

相关内容