关于Ubuntu的Matlab坚持“拿起JAVA_TOOL_OPTIONS:`

时间:2016-05-17 10:32:13

标签: java matlab ubuntu

我想在没有cd /usr/local/MATLAB/R2015b/binsudo ./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/binsudo ./matlab命令可以正常运行。

如果我直接使用sudo ./matlab,则会显示sudo:./matlab: command not found

其他信息:which java显示/usr/bin/java

unset JAVA_TOOL_OPTIONS会导致其他错误。

1 个答案:

答案 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.

enter image description here

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.