I recently come across an issue with my Eclipse SWT GUI application. I was trying to acquire a window handle with the following code:
Display.getDefault().syncExec(()->{
handle = Display.getDefault().getActiveShell().handle;
});
worked perfectly on my 64bit Windows 10 OS.
Then when I deploy the same app on a 32bit Windows machine (a VM I setup on my pc using Hyper-v), I get the following weird error:
java.lang.NoSuchFieldError: handle
The documentation for this handle says:
long org.eclipse.swt.widgets.Control.handle
the handle to the OS resource(Warning: This field is platform dependent)
IMPORTANT: This field is not part of the SWTpublic API. It is marked public only so that it can be >sharedwithin the packages provided by SWT. It is not available on allplatforms and should never be >accessed from application code.
Could this be the reason that was causing this issue?
If we can't use this property, what are the alternatives? I know JNI / JNA deals with native code, they still rely on SWT implementation to acquire the handle as far as I know.
Thanks for taking time on my question!
Cheers!