Why do I get the error message "??? Error Using==> javaObject" when I try to use Java objects that call native methods?
10 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2009-6-27
编辑: MathWorks Support Team
2013-10-26
I have a JAR file that includes a Java class that calls a native method. After making this class available to MATLAB by adding the full path and filename of the JAR file to classpath.txt, I get the following error message when I try to invoke the Java object constructor in MATLAB:
jo = javaObject('com.freddiemac.fir.finance.TermStructure')
??? Error using ==> javaObject
No class com.freddiemac.fir.finance.TermStructure can be located on Java
class path.
采纳的回答
MathWorks Support Team
2013-10-18
In the case where your Java object calls a native method, this error message indicates that you do not have your system path set correctly.
Native methods are implemented in shared libraries or dynamic-link libraries, and if the location of the shared libraries is not set in the environment variable "Path", a java.lang.UnsatisfiedLinkError error occurs and the object is not created in MATLAB.
For information on setting your system path, see the Related Solution listed below.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Java Client Programming 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!