title: Tomcat and Matlab MCR invalid MEX-file error
body: <p>I have Tomcat 7 and MCR 8.3 installed on my Ubuntu 14.04 server.
  Matlab is correctly installed, because I can execute some program, but when I try to execute others i have this error:</p>
  
  <blockquote>
    <p>Invalid MEX-file '/usr/local/MATLAB/MATLAB_Compiler_Runtime/v83/mcr/toolbox/matlab/sparfun/etree.mexa64': libmwarpack.so: cannot open shared object file: No such file or directory</p>
  </blockquote>
  
  <p>I set the environment in my /etc/profile.d folder in this way:</p>
  
  <pre><code>MCR_ROOT=/usr/local/MATLAB/MATLAB_Compiler_Runtime/v83
  export PATH=$PATH:$MCR_ROOT/bin:$MCR_ROOT/bin/glnxa64
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MCR_ROOT/runtime/glnxa64:$MCR_ROOT/bin/glnxa64:$MCR_ROOT/toolbox/javabuilder:$MCR_ROOT/sys/os/glnxa64:$MCR_ROOT/sys/java/jre/glnxa64/jre/lib/amd64/server:$MCR_ROOT/sys/java/jre/glnxa64/jre/lib/amd64:$MCR_ROOT/sys/java/jre/glnxa64/jre/lib/amd64/native_threads:$MCR_ROOT/mcr/toolbox/matlab/sparfun:$MCR_ROOT:mcr/toolbox
  export LD_LIBRARY_PATH
  export MCR_CACHE_ROOT=/home/bull/MCR/cache
  export XAPPLRESDIR=$MCR_ROOT/X11/app-defaults
  </code></pre>
  
  <p>I was a bit frustrated and I added some folder more... 
  The etree.mexa64 and libmwarpack.so files are correctly located.</p>