Why does MATLAB 6.5 (R13) fail to locate my Java class even though I have added it to classpath.txt file?

5 views (last 30 days)
I am trying to use my Java class (called SerialInterface) in MATLAB, and I added the path of that class to classpath.txt file, however, MATLAB could not find that class.
When I try to invoke that class:
SerialInterface
I receive the error message:
??? Undefined function or variable 'SerialInterface'.
When I use the command:
javaObject('SerialInterface')
I receive the same error message.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
There is a limitation in MATLAB 6.5 (R13) when calling Java classes that were compiled with a JVM version that does not match MATLAB's JVM version.
To work around this issue, make sure that the JVM version used to compile the Java classes matches MATLAB's JVM version. To see which JVM version MATLAB is using, type the following command at the MATLAB command line:
version -java
You may also consider changing the JVM version that MATLAB uses instead. For more information, refer to the Related Solutions section.
Note : MATLAB is only fully supported with the JVM that it ships with. Some components may not work properly under a different version of the JVM.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!