Search code examples
javamatlabuser-interfacedata-acquisition

Java GUI in Matlab2011a and 64bit Win7


Earlier this year I code Java GUI to work in Matlab environment for image acquisition purposes. I was able to call Java_Gui.jar inside the matlab, as well as to use some of the classes from the .jar file. The GUI was tested on WinXP 32bit, and Matlab2006b and Matlab 2008a. Matlab code for calling Java classes:

clc,clear all,close all

javaaddpath('C:\Users\...\JavaGUI.jar');

JavaGUI.main([]);
pause(1)
JavaGUI.main2();

However, when tried same program with Win7 on 64bit and Matlab2011a the familiar problem occurred:

??? Java exception occurred:
java.lang.UnsatisfiedLinkError: no sserial in java.library.path

Any idea why is this happening? Maybe I should compile my jar file on 64bit version? The code is still working on 32bit Win, just checked it.

ANSWER: Works with 32-bit version of Matlab on 64-bit Windows 7!


Solution

  • Probably your JAR uses JNI.

    JNI won't be able to load into a process of a different bitness than the DLL containing the native portions. You'd need a 64-bit version of the library (the Java code is no different, the native DLLs are) in that case.