0

I have a .net dll which has some functions that i need to call from a java program. This is the code that I have used which is giving me this error."Exception in thread "main" java.lang.UnsatisfiedLinkError:" but the dll loads fine. s

static {
        try {

            System.load("mydotnet.dll");
            System.out.println("loaded");

        } catch (UnsatisfiedLinkError e) {
            System.err.println(e);

        }
    }

    private static native boolean SC_Start();
MorganM
  • 195
  • 1
  • 1
  • 10

1 Answers1

0

Is your DLL in a directory on the Java PATH?

If not, either:

  1. Add the directory containing the DLL to the PATH
  2. Move the DLL to a directory already in the PATH
  3. Or use the full path to the DLL, eg C:\Path\To\Directory\mydotnet.dll
Jon Story
  • 2,881
  • 2
  • 25
  • 41
  • the dll load well but accessing the function in the dll is giving this errror:Exception in thread "main" java.lang.UnsatisfiedLinkError – MorganM Sep 25 '14 at 14:02
  • Is your DLL set up to be used by Java? Java can't just load and use any old .NET DLL See this answer for an explanation http://stackoverflow.com/questions/8675179/accessing-dll-methods-in-java – Jon Story Sep 25 '14 at 14:16