我不是Linux专家,在我做错之前,我想了解如何设置我的环境变量。安装Matlavb MCR后,我收到了这条消息:
On the target computer, append the following to your LD_LIBRARY_PATH environment variable:
/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/bin/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/server:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64
Next, set the XAPPLRESDIR environment variable to the following value:
/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/X11/app-defaults
我有一个Red Hat服务器,我读到了导出命令或
在/etc/ld.so.conf.d/中添加一个文件(它应以.conf结尾),包含 目录的完整路径
将此路径永久添加到环境变量的最佳做法是什么?谢谢
答案 0 :(得分:0)
在.bashrc
文件(或相应的资源文件,如果您使用不同的shell)中,输入以下代码:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/bin/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64/server:/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/sys/java/jre/glnxa64/jre/lib/amd64
export XAPPLRESDIR=/usr/local/MATLAB/MATLAB_Compiler_Runtime/v81/X11/app-defaults
注意:如果使用不同的shell,语法可能略有不同。