MATLAB: Which Java Virtual Machine is used by an application compiled using the MATLAB Compiler 4.3 (R14SP3)
MATLAB Compiler
I would like to specify the JVM used by my MATLAB Compiled application.
Best Answer
A MATLAB compiled application uses the MATLAB Compiler Runtime's (MCR) embedded Java VM (Virtual Machine) unless the MATLAB_JAVA environment variable points to another one.
Thus, following are the scenarios:
1) If MATLAB_JAVA environment variable is not set or is empty, the MCR's JVM is used.
2) If MATLAB_JAVA environment variable is set to point to the root directory of a particular JVM, the JVM being pointed to is used by MATLAB.
Also, here is a simple test to find out which JVM is used by a compiled application:
1) Create a MATLAB function that outputs the JAVA version:
function checkJavaVersion
version -java
2) Compile this application using the MCC command:
mcc -m checkJavaVersion
3) Run this application to check the version of JAVA that a compiled MATLAB application will use. From a shell or terminal:
At this time, it is not possible to use MATLAB Compiler to make a portable application. Applications that have been compiled with MATLAB Compiler, require the MATLAB Compiler Runtime and the requisite permissions to install them on the target machine.
The ability to run an uncompiled MATLAB program against a MATLAB Compiler built standalone application and the MATLAB Compiler Runtime is not available, as of MATLAB Compiler 4.8 (R2008a).
You will need to recompile the standalone application.
Best Answer