Question

I've looked through a number of posts, and tried what I've found to little success. Here's the setup:

I wrote a program in Java, worked alright, but we needed to switch cameras. This camera is Twain compatible (yuck). I rewrote the program (pretty simple), using JTwain, and it runs just fine in netbeans. I built it, and it runs just fine on my computer. However, when I try and transfer the .jar (and companion library etc.), it runs fine until it needs to take an image, then I get the error:

java.lang.UnsatisfiedLinkError: no aspireJTwain in Java.library.path.

I've tried bringing the base twain package over, adding the system environmental variables, checking the java distribution. I can run the JTwain test file (to make sure you have JTwain and everything is hunky dory).

If someone could please lend a hand, I'd be much obliged.

Was it helpful?

Solution

Can you check to make sure that you have followed the directions from the The Java Developer's Guide to JTwain v9.

6.3 Software Packaging and Distribution

There are two files about JTwain you need to distribute along with your own binary code. One is JTwain.jar, which is like any other java library, you can just copy it and put it in the class path. The other one is AspriseJTwain.dll, the native library. There are many ways to 'install' this dll file, you can: Add the folder containing the native library to the system path, or Copy the native library to jre/bin directory – 'install' the library to the JVM, or Copy the native library to a specific location, e.g. C:\AspriseJTwain.dll, before calling SourceManage.instance(), call: SourceManage.setLibraryPath(“ C:\AspriseJTwain.dll ”);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top