MATLAB: Do I get a crash when using a .NET shell command to execute a MATLAB program compiled with MATLAB Compiler 7.14 (R2010b)

MATLAB Compiler

When I use the UseShellExecute() command to execute a MATLAB program that was compiled to a .exe, I get the following crash:
# # An unexpected error has been detected by Java Runtime Environment: # # Internal Error (0xe06d7363), pid=7064, tid=5876 # # Java VM: Java HotSpot(TM) Client VM (11.2-b01 mixed mode windows-x86) # Problematic frame: # C [kernel32.dll+0x1e124] # # An error report file with more information is saved as: # C:\Windows\TEMP\hs_err_pid7064.log # # If you would like to submit a bug report, please visit: # <http://java.sun.com/webapps/bugreport/crash.jsp> # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # Opening log file: C:\Windows\TEMP\java.log.7064
I am able to execute other non-MATLAB related executables without any problem.

Best Answer

It is likely that the user account the webserver is running under does not have write access to the directory where the preferences are going to be written. The best workaround is to set the MATLAB_PREFDIR environment variable to a directory that is writeable by the webserver user. The webserver machine will have to be restarted after the environment variable change.