Jetmir
Jetmir

Reputation: 21

Problems with calling a java class in matlab

I am facing a problem when I try to call a java class in MATLAB. I created a java class, I compiled it as .jar file in Netbeans 7.3.1. When I use the normal procedure to add the path of the .jar file with javaaddpath() and after that to import the class with import I can not access the class. It says no such class or function was found.

This happens just with the class I created but not with other classes that were compiled by others. I can execute the jar file with system('java -jar jarfile.jar') in MATLAB. So it seems that the problem is within matlab and not with java code.

I use MATLAB R2013a and JAVA 1.7.

Is there a problem with version compatibility or what!?

Upvotes: 1

Views: 330

Answers (1)

sebastian
sebastian

Reputation: 9696

Matlab 2013a ships with java 1.6 (check ver).

You'll either have to compile your class with java 1.6 as well or make MATLAB run with java 1.7: http://www.mathworks.de/support/solutions/en/data/1-1812J/

Upvotes: 2

Related Questions