我想在没有cd /usr/local/MATLAB/R2015b/bin
和sudo ./matlab
的情况下打开Matlab。
所以我sudo gedit ~/.bashrc
并在结尾处写下以下命令:
export MATLAB_ROOT="/usr/local/MATLAB/R2015b/bin"
if [ -d "${MATLAB_ROOT}" ]; then
export PATH="${PATH}:${MATLAB_ROOT}"
fi
source ~/.bashrc
之后我使用echo $PATH
看到matlab的路径确实存在。但是,当我使用matlab
打开它时,它将停留在Picked up JAVA_TOOL_OPTIONS:
,而cd /usr/local/MATLAB/R2015b/bin
和sudo ./matlab
命令可以正常运行。
如果我直接使用sudo ./matlab
,则会显示sudo:./matlab: command not found
其他信息:which java
显示/usr/bin/java
unset JAVA_TOOL_OPTIONS
会导致其他错误。
答案 0 :(得分:0)
Oh, I found the problem, I use the command JAVA_TOOL_OPTIONS=/usr/local/MATLAB/R2015b/bin
or unset JAVA_TOOL_OPTIONS
, and then get the error as follows.
It makes me recall the sudo
command, so it might be a problem of permission right. Since I have to open Matlab without leaving that directory, I use ln -s /usr/local/MATLAB/R2015b/bin/matlab /path/to/your/current
and then sudo ./matlab
. It works.
But how to really solve this problem remains unknown. The other methods I saw like sudo apt-get remove jayatana
and sudo rm /usr/share/upstart/sessions/jayatana.conf
may cause unpredictable result, so I could not try them.