Search code examples
javaeclipsejna

Class location for User32 in JNA 4.1.0


I have read about using native Window handles in Java. I have downloaded the JNA 4.1.0 JAR file and added to the Eclipse Java Build Path.

However, when I type User32 and press Ctrl+Space, Eclipse doesn't give suggestions for an import.

What I have tried: I have created my own User32 class like in this answer.

However, I doubt that this is the correct way of doing it. Maybe I'm too optimistic, but I expect it to be easier... :-)


Solution

  • As pointed out in the comments, I forgot to add jna-platform.jar to the Java Build Path.