MATLAB: Do I get “requires java” error message when I compile a function that uses SENDMAIL to a standalone application with MATLAB Compiler 4.11 (R2009b)

environmentjavajrejvmMATLAB Compilernojvmruntimesendmail

I have a MATLAB function in which the SENDMAIL function is used. I compile the MATLAB function to a standalone application with the command below:
mcc -m -v SendMailTrial.m -R -nojvm
When I run the executable created, I get the following error message:
??? Error using ==> sendmail at 39
SENDMAIL requires Java.
Error in ==> SendMailTrial at 1
MATLAB:sendmail:NoJvm

Best Answer

The documentation on MATLAB Compiler does not mention the list of functions that need the Java Virtual Machine (JVM) to run.
The error message seen is expected as the SENDMAIL function requires the JVM to run. In order to resolve the issue, please do not use the 'nojvm' runtime option when compiling an application that uses the SENDMAIL function.