Are JAR files built using MATLAB Compiler SDK platform independent?

2 visualizaciones (últimos 30 días)
I would like to compile my M-function into a Java class using MATLAB Compiler SDK (MATLAB Builder JA in earlier releases) on one platform and distribute my Java archive in a platform independent manner.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 21 de Jul. de 2020
Editada: MathWorks Support Team el 21 de Jul. de 2020
In general Java classes built using MATLAB Compiler SDK are platform independent since MATLAB files are platform independent, as are JAR-files. There is a caveat when using C code shared libraries or MEX files which are not platform independent. In some instances, the MATLAB or Toolbox functions you are using in your application may depend on MEX files.
In this case, the easiest solution is to recompile the Java module with MATLAB Compiler SDK on each target platform.
It is also possible to avoid recompiling by moving the corresponding MEX files from each platform to your compile machine and include them in the build process using the –a flag to archive these files in the CTF.
Please see the documentation on “Ensuring Multi-Platform Portability”.

Más respuestas (0)

Categorías

Más información sobre Troubleshooting in MATLAB Compiler SDK en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by