1
Exception in thread "main" java.lang.UnsatisfiedLinkError: dpapi.DPAPI.CryptProtectData(Ljava/lang/String;[BZ)[B
    at dpapi.DPAPI.CryptProtectData(Native Method)
    at dpapi.DataProtector.protect(DataProtector.java:60)
    at dpapi.Main.main(Main.java:36)

code

public class Main {

    static {
        System.load(new File("jdpapi-native-1.0.dll").getAbsolutePath());
    }
    public static void main(String[] args) {

    DataProtector p = new DataProtector();
    String x ="abc";
    String y = p.protect(x).toString();

    }

}

I know the library is loaded but i have no idea why i am still getting the execption. link:http://jdpapi.sourceforge.net/

BeyondProgrammer
  • 893
  • 2
  • 15
  • 32

1 Answers1

0

check your Java CPU architecture (32bit or 64bit) equals you dll. 32-bit windows process can't load 64-bit dll and via versa...

dimzon
  • 414
  • 4
  • 13