how to use .dll files in java code?

后端 未结 3 1294
旧时难觅i
旧时难觅i 2021-01-24 10:29

I have a .dll file, which i have to use in java. This .dll file has a parameterised method, which should return type as string. When i am passing parameter to it, i get the mes

相关标签:
3条回答
  • 2021-01-24 11:01

    public native String eagleye_fmu(n); The 'n' here is the problem as it would be a problem with any other java function declaration.

    This should be something like public native String eagleye_fmu(String); then you call the native function like any other function String result = eagleye_fmu(n);

    This is all assuming you have the dll implemented properly

    0 讨论(0)
  • 2021-01-24 11:15

    Simple add the reference in you project. and the namespace at the top.. then you can access the all dll methods. If your are using Eclispe then right click on your project->Then click on Build path-> then click on Add libraries after that click on user library

    Here you can import the dll

    0 讨论(0)
  • 2021-01-24 11:23

    Try having a look at JNA, it provides a nice wrapper layer around native code.

    https://github.com/twall/jna

    0 讨论(0)
提交回复
热议问题