2

How do I call a DLL inside Java program ?

Nick Stinemates
  • 41,511
  • 21
  • 59
  • 60
Isabel Jinson
  • 8,541
  • 16
  • 59
  • 75

2 Answers2

8

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

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • 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 – CDR Apr 21 '09 at 06:22
  • 2
    Unfortunately I don't know that history. – Jon Skeet Apr 21 '09 at 06:36
3
System.load("C:\\Windows\\System32\\yourdllname.dll");

if thats your path to your dll

TStamper
  • 30,098
  • 10
  • 66
  • 73