Is it possible to use the MATLAB Java interface to load a MATLAB Builder JA generated JAR package?

1 view (last 30 days)
I have created a Java JAR package by using the Java Package target of MATLAB Builder JA using the DEPLOYTOOL or MCC functions. I would like to load this package into the MATLAB workspace and call its functions.
I can add this JAR file to the dynamic path with JAVAADDPATH, but when I try to instantiate a class object from the package, I get the following exception:
Java exception occurred:
... Matlab M-code Stack Trace ...
com.mathworks.toolbox.javabuilder.MWException: Component created using MATLAB Builder JA cannot be
loaded in MATLAB

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 11 Dec 2012
This change has been incorporated into the documentation in Release 2012b (R2012b). For previous releases, read below for any additional information:
As seen in the error message, a JAR package generated by MATLAB Builder JA indeed cannot be loaded in MATLAB using the Java interface. There are no workarounds.

More Answers (0)

Categories

Find more on Java Package Integration 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!