| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB Builder JA |
| Contents | Index |
| Learn more about MATLAB Builder JA |
CTF archives containing only M-files are platform independent, as are .jar files. These files can be used out of the box on any platform providing that the platform has either MATLAB or the MCR installed.
However, if your CTF archive or JAR file contains MEX-files, which are platform dependent, do the following:
Compile your MEX-file once on each platform where you want to run your MATLAB Builder JA application.
For example, if you are running on a Windows machine, and you want to also run on the Linux® 64-bit platform, compile my_mex.c twice (once on a PC to get my_mex.mexw32 and then again on a Linux 64-bit machine to get my_mex.mexa64).
Create the MATLAB Builder JA component on one platform using the mcc command, using the -a flag to include the MEX-file compiled on the other platform(s). In the example above, run mcc on Windows and include the -a flag to include my_mex.mexa64. In this example, the mcc command would be:
mcc -W 'java:mycomp,myclass' my_m-file.m -a my_mex.mexa64
For example, if you are running on a Windows machine and you want to ensure portability of the CTF file for a MATLAB Builder JA component that invokes the yprimes.c file (from matlabroot\extern\examples\mex) on the Linux 64-bit platform, execute the following mcc command:
mcc -W 'java:mycomp,myclass' callyprime.m -a yprime.mexa64
where callyprime.m can be a simple M-function as follows:
function callyprime disp(yprime(1,1:4));
Ensure the yprime.mexa64 file is in the same folder as your Windows MEX-file.
Tip If you are unsure if your JAR file contains MEX-files, do the following:
|
Caution Some toolbox functionality will not be deployable when compiled into a Java component and run on a platform other than the one compiled on. This is because some toolbox code includes data that may be platform specific. If this is the case, you can only deploy the application to like platforms. For example, the Image Processing Toolbox function IMHIST will fail if deployed cross-platform with an undefined function error. |
JAR files produced by MATLAB Builder JA are tested and qualified to run on platforms supported by MATLAB. See the Platform Roadmap for MATLAB for more information.
![]() | Blocking Execution of a Console Application that Creates Figures | Using MCR Component Cache and MWComponentOptions | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |