NoSuchMethodError: com.sun.jna.platform.win32.WinGDI$ICONINFO.createFieldsOrder

194 views
Skip to first unread message

titoasty

unread,
Jan 11, 2018, 10:48:56 AM1/11/18
to Java Native Access
Hi,

When I try to load user32 library, via this line :
Native.loadLibrary("user32", User32.class);

I've got this error :
Exception in thread "main" java.lang.NoSuchMethodError: com.sun.jna.platform.win32.WinGDI$ICONINFO.createFieldsOrder([Ljava/lang/String;)Ljava/util/List; at com.sun.jna.platform.win32.WinGDI$ICONINFO.<clinit>(WinGDI.java:176) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.sun.proxy.$Proxy0.<clinit>(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739) at com.sun.jna.Native.loadLibrary(Native.java:506) at com.sun.jna.Native.loadLibrary(Native.java:481) at com.dsb.skincare.util.VirtualKeyboard.<clinit>(VirtualKeyboard.java:22) at com.dsb.skincare.Main.main(Main.java:8)

Environment :

jna : 4.5.1
jna-platform : 4.5.1
jdk : jdk1.8.0_151
os : windows 10 64bit
Thanks for your help

Matthias Bläsing

unread,
Jan 11, 2018, 2:21:28 PM1/11/18
to jna-...@googlegroups.com
Hi,

Am Donnerstag, den 11.01.2018, 07:48 -0800 schrieb titoasty:
> I've got this error :
> Exception in thread "main" java.lang.NoSuchMethodError: com.sun.jna.platform.win32.WinGDI$ICONINFO.createFieldsOrder([Ljava/lang/String;)Ljava/util/List
> Environment :
>
> jna : 4.5.1
> jna-platform : 4.5.1


I'm not sure whether or not you read the info part when I closed the
bug:

I wager, that you have an older version of JNA on your classpath (I
think createFieldsOrder was introduced in the 3->4 transition). Whether
you depend directly on this or get it via a transitive dependency is a
different matter though. Without the complete project data this is as
much as can said.

Greetings

Matthias

titoasty

unread,
Jan 12, 2018, 6:19:42 AM1/12/18
to Java Native Access
Hi Mathias,

I saw it, thanks, just wanted to keep it here for other people, in any case (and not spam the issue on github).
I'll investigate what you said, so many libraries in the project so it seems totally plausible :)
Thanks again for your help, will keep informed for others.
Reply all
Reply to author
Forward
0 new messages