0

I'm trying to work with the Java sample Database program from the CardScan SDK.

I am working with files located in Java/JNI and Java/Database. The program must be run with a 32 bit JRE. I was able to do so on a 64 bit machine by uninstalling Java and installing the 32 bit version, then re-adding the system path for Java. I can run the program and interface with a CardScan database file (.cdb) successfully by double clicking the SDKData.bat file, but when I open the source files for editing and edit the Java.library.path to include the required library (CRTK_JNI.dll), I get UnsatisfiedLinkErrors everywhere:

Exception in thread "main" java.lang.UnsatisfiedLinkError: sdkdata.CRTK.CRTK_Init([I)I
at sdkdata.CRTK.CRTK_Init(Native Method)
at sdkdata.CRTK.(CRTK.java:239)
at sdkdata.SDKData.(SDKData.java:97)
at sdkdata.SDKData.main(SDKData.java:643)
Java Result: 1

Presumably this is happening because the library is not loading properly.

What do I need to do to run and edit the program at full capacity (with all the native functions from CRTK_JNI in working order)?

blastb
  • 1
  • 1
  • 3

2 Answers2

2

Presumably this is happening because the library is not loading properly.

On the contrary. The library load is complete. You aren't getting that from a System.load()/loadLibrary() call, you are getting the error when calling your native method, the one that should have the signature:

package sdkdata;

public class CRTK
{
  public native int CRTK_Init(int[]);
}

So it isn't there, or you have changed the signature without regenerating the .h and .c files, or you have manually mangled the declaration some other way.

Post your code.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • I did post my code, but it was edited away by a moderator for some reason. Probably should have paid more attention to question rules, sorry about that. – blastb Jan 22 '13 at 20:57
0

To clarify, this Java sample program is officially unsupported by the CardScan API - it was a bad idea to try to use the API with an unsupported language relying solely on an experimental implementation. I ended up using one of the supported languages (Visual Basic) to work with the SDK; if anyone looking at this question happens to be struggling with using the CardScan API, here is my VB implementation on Github.

blastb
  • 1
  • 1
  • 3