By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,024 Members | 2,027 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,024 IT Pros & Developers. It's quick & easy.

SWT Extension toolKit - java.lang.UnsatisfiedLinkError

Ganesh9u
P: 23
Hi All,

import org.sf.feeling.swt.win32.extension.hook.Hook;
import org.sf.feeling.swt.win32.extension.hook.data.HookD ata;
import org.sf.feeling.swt.win32.extension.hook.data.Mouse HookData;
import org.sf.feeling.swt.win32.extension.hook.listener.H ookEventListener;

public class HotMouse
{

public static void main(String[] args) {
Hook.MOUSE.addListener(new HookEventListener() {
public void acceptHookData(HookData hookData) {
if (hookData != null)
{
System.err.println(((MouseHookData)hookData).getPo intX()"," ((MouseHookData)hookData).getPointY());
}
if (hookData.getWParam() == 513) { System.out.println("left button pressed");// left button pressed
} else if (hookData.getWParam() == 514) { System.out.println("left button released");// left button released
} else if (hookData.getWParam() == 516) { System.out.println("right button pressed");// right button pressed
} else if (hookData.getWParam() == 517) { System.out.println("right button");// right button
} else if (hookData.getWParam() == 519) { System.out.println("middle button 519");// middle button
} else if (hookData.getWParam() == 520) { System.out.println("middle button 520");// middle button
}
}
});
Hook.MOUSE.install();
}

}


I have Used SWT Win32 Extension 1.0.5 toolkit for Mouse & Keyboard hook operation, in java.
I am using Eclipse J2EE Latest version, I also added those external jar files(SWT Win32 Extension all Jar files),
At design time I did not get any error when I run this program.


When I Run this Program I got the error as

Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: no swt-extension-win32 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.sf.feeling.swt.win32.internal.extension.Extens ion.<clinit>(Extension.java:42)
at org.sf.feeling.swt.win32.internal.extension.EventO bject.<init>(EventObject.java:34)
at org.sf.feeling.swt.win32.extension.hook.Hook$HookE ventLoop.run(Hook.java:328)
at java.lang.Thread.run(Unknown Source)

What might be the problem ? and what can be done. any solution.

-Thanks In Advance..
Aug 24 '09 #1
Share this Question
Share on Google+
1 Reply


Expert 10K+
P: 11,448
@Ganesh9u
I never used SWT but that error message indicates that a .so (or .dll) file could not be found for loading; the jvm wants to load the file 'swt-extension-win32' but can't find it anywere on the path 'java.library.path' designated for dynamic link libraries.

kind regards,

Jos
Aug 24 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.