1

I am writing a program that uses JNI, and it works fine when I run it on my computer, but it throws an UnsatisfiedLinkError if I try to run it on another compupter, saying that it cannot find the dependent libraries. I use Eclipse, and I've tried everything (or a lot of things, whichever you prefer).

Can someone tell me how to fix this?

TheRandomLabs
  • 87
  • 1
  • 11

1 Answers1

1

First, check if you copied all DLL's you use in your project to the target system.
If the error still occurs, it seems that one or more DLL's your JNI-DLL's depending on are missing on the target system.

Download Dependency Walker to your other computer and load the DLL you're using with Dependency Walker.
It lists all DLL's your DLL is relying on and even shows if a dependency is missing. If there's something missing, copy the files either from your system or download them.

Rikan
  • 155
  • 9
  • Dependency Walker found a bunch of missing dlls, all of them beginning with "API-MS-WIN-" or "EXT-MS-WIN-". Note that I am compiling my project in both 32 bit and 64 bit. – TheRandomLabs Aug 22 '15 at 08:04
  • Make sure you have installed the same vc++ redistributables on both machines. If the problem still persists, try to collect all dependencies of your project on your machine and copy them to the target. There is a similar problem to yours [here](http://stackoverflow.com/questions/17023419/win-7-64-bit-dll-problems) – Rikan Aug 24 '15 at 12:50
  • I have tested it on a Windows 10 notebook and a Windows 10 VM. They both have the same VC++ redistributables. – TheRandomLabs Aug 24 '15 at 22:08
  • I'm afraid I'm out of ideas, but I have a similar problem. My Javaproject uses JNI too and I'm using NetBeans for development. After upgrading from Windows 7 to Windows 10, my project won't run in Netbeans anymore. Running my project outside of NetBeans from command line, even though Dependency Walker can't find API-MS-WIN and EXT-MS-WIN DLL's. [Here's my question](http://stackoverflow.com/questions/31746561/unsatisfiedlinkerror-in-netbeans-when-calling-native-dll-after-windows-10-upgrad), if you've found a solution, please let me know, maybe it's helpful for me, too. – Rikan Aug 25 '15 at 07:53
  • I'm on Windows 10 as well. I'm not sure if this started happening on my computer when I updated to Windows 10 though. – TheRandomLabs Aug 25 '15 at 11:05