Is the entirety of the system folder generated by the MATLAB Compiler SDK web installer necessary to deploy a Java package?
6 views (last 30 days)
Show older comments
MathWorks Support Team
on 29 Mar 2023
Answered: MathWorks Support Team
on 5 Apr 2023
I've written a MATLAB function in MATLAB R2022a and deployed it as a Java package called "MyJavaPackage.jar".
When using MATLAB Compiler SDK to create a Java package for my MATLAB function, it appears to create a web installer that does two things:
- Installs the correct MATLAB Compiler Runtime version.
- Installs a "system" folder for the Java package. It appears the system folder contains multiple documentation files and one non-documentation file that is "MyJavaPackage.jar". Can I provide just the "MyJavaPackage.jar" file to my end user, or do I need to also provide the remaining contents of the system folder as well (eg. "doc" subdirectory, "default_icon" .ICO file, "GettingStarted" webpage, etc.)?
It would simplify things a lot if I can forgo sending these additional files to the end user and just have them place "MyJavaPackage.jar" exactly where it needs to be in their working directory. Of course, they would have to download and install the correct MATLAB Compiler Runtime version themselves separately.
I'm interested in the answer to this question on both Windows 10 and Ubuntu.
Accepted Answer
MathWorks Support Team
on 29 Mar 2023
Compiled MATLAB R2022a code comprising only MATLAB files is platform independent, as are Java .JAR files in general. You can execute such files on any platform (eg. Windows, Mac, Linux), provided that the platform has the correct MATLAB Compiler Runtime version installed.
However, for compiled MATLAB R2022a code containing MEX files, please note that MEX files are platform dependent and consequently, there are some additional steps that you must perform to create the Java package as described in the documentation linked below:
In summary, the end user of the Java package does not need any additional files besides the .JAR file created by the web installer within the system folder. They only need the .JAR file, as well as the appropriate version of MATLAB Compiler Runtime installed on their machine.
0 Comments
More Answers (0)
Categories
Find more on Troubleshooting in MATLAB Compiler SDK in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!