Good afternoon, I work with JNA trying to connect a library to the .dll but IDEA gives an error when connecting it, that is, it emphasizes loadLibrary

ClientW ClientW = (ClientW) java.lang.annotation.Native.loadLibrary("spn", ClientW.class); 

when you write on it

Cannot resolve method 'loadLibrary (java.lang.String, java.lang.Class Client.class)'

    1 answer 1

    Java.lang.annotation.Native Documentation

    Where did you find the loadLibrary method?

    UPD:

    Code from the example:

     import com.sun.jna.Native; ... MyLib lib = (MyLib) Native.loadLibrary("my", MyLib.class); 

    Your code:

     java.lang.annotation.Native.loadLibrary("spn", ClientW.class); 

    Find 3 differences. Hint com.sun.jna.Native != java.lang.annotation.Native

    • I do not understand the question ? So the studio writes about the connection if it is shown in the examples. - Varg Sieg
    • @VargSieg I don’t know where you get the examples from, but java.lang.annotation.Native is not even a class, but it doesn’t have a summary and methods in principle. Follow the link to the documentation and read carefully. After enlightenment, purely for interest, complete the question with an example that you are trying to follow - maybe you just misunderstood it. - rjhdby
    • Here is an example of habrahabr.ru/post/113436 and here’s another ru.intechcore.com/jna-for-access-to-native-com-dll-library - Varg Sieg
    • @VargSieg Completed the answer - rjhdby
    • You are right. I didn’t pay attention to this, but why then IDEA doesn’t want to change the java.lang.annotation.Native to the com.sun.jna.Native library, but when I try to import the com.sun.jna it changes to java.lang.annotation ? - Varg Sieg