How to implement Dllinsce32.dll from sintegra in Java corretamante

Asked

Viewed 169 times

0

You need to create a Java function that receives Dllinsce32.dll, provided by Sintegra to verify the consistency of State Registrations. But when passing the DLL location appears:

"Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load 
library 'DllInscE32': Native library (win32-x86-64/DllInscE32.dll) not found 
in resource path ..."

The code of the function:

public class Validar_IE{
    protected static final Object ebfCallNativeFunction(String libraryName, String functionName, List argsList, String returnType) throws Exception {

        Object[] argValues = new Object[argsList.size()];
        for (int i = 0; i < argsList.size(); i++) {
          List arg = (List) argsList.get(i);
          argValues[i] = (String) arg.get(1);
        } 
        com.sun.jna.Native.setProtected(true);
        com.sun.jna.Function func = com.sun.jna.Function.getFunction(libraryName.toString(), functionName.toString());
        Object result = func.invoke(Class.forName(returnType), argValues);
        return result;
      }  
}
  • Are you using eclipse or netbeans? And how did you implement the DLL path in classpath

  • Have a look here might be something https://stackoverflow.com/questions/8113080/cant-load-ia-32-bit-dll-on-a-amd-64-bit-platform

  • I used netbeans, put Dll in both System32 and sysWOW64. and used an algorithm to add classpath. 'System.setProperty("java.library.path", myLibraryPath);'

  • I managed to run by switching jdk 1.8 to 32-bit.

  • Perfect, post the answer here then

1 answer

0

With the help of user Fabricío I managed to solve. I switched the JDK in netbeans from x64 to x32 to use the DLL.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.