tags:

views:

499

answers:

3

Hi All: This problem is really befuddling me and hopefully someone could help me out. I've written some plugin libraries for a large java software. Everything works fine and well on my development computer. However, after I compiled and wrapped the software in Nullsoft Installer and install onto another computer, everything but the native dll plugins I developed runs, and I get a UnsatisfiedLinkError when I call System.loadLibrary. The installer works on my dev computer, the installed software runs fine even after I moved the original software. Here's what I do know:

  • the native libraries are deved in .NET (C++/CLI) hooked in by JNI

  • The software on the new computer is loading the right library path, can see the native dlls. In Java, I've added a segment to check the permissions on the files using File class, Java runs fine on library_dll.canRead() and library_dll.canWrite(), but hangs/crashes on library_dll.canExecute().

If anyone can help me, I would really appreciated it!!! Thank you all!

A: 

Does the target computer have .NET installed, and the right version of .NET at that?

I can't say I've ever done any .NET/JNI interop - it sounds potentially tricky to me. Have you looked at using JNBridge to make things easier?

Jon Skeet
A: 

Thanks Jon! No, the target computer does not have .NET installed (at least none more than the ones windows have at default). But it seems like JAVA/JNI can't even load the dll... I will try installing .NET framework and see

.NET/JNI interop was not the difficult part, that is working on my dev comp... It was tricky but not too difficult.

A: 

I would suggest that you run FileMon on the computer which is giving the problem, and then try to run your application. After FileMon captures data, you should see all file accesses made by your Java application and see the exact failure which leads to the UnsatisfiedLink error. For example, it may be that some dependency of your JNI DLL is missing on the other computer (this sounds like a good possibility, after security/permission errors).

Vinay Sajip