Saturday, April 30, 2011

How do I call dll inside Java?

How do I call a DLL inside Java program ?

From stackoverflow
  • System.load("C:\\Windows\\System32\\yourdllname.dll");
    

    if thats your path to your dll

  • The canonical answer is JNI. However, this is somewhat painful. Other options:

    CDR : If you also add which one is the latest and best that would have been helpful too. Like initialy it was JNI. Then someone wrote a better solution Swig. Then finding Swig's limitation some wrote JNA which is double faster than Swig etc
    Jon Skeet : Unfortunately I don't know that history.

0 comments:

Post a Comment