File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes JNI program works, copy of it doesn't Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "JNI program works, copy of it doesn Watch "JNI program works, copy of it doesn New topic
Author

JNI program works, copy of it doesn't

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I have a program that uses JNI to talk to the Attachmate Extra 3270 emulator. Running the main() method executes a little test scenario that works just fine. I copy the source file and paste it into the same package with a new name and WSAD/Eclipse renames everything ok. The copy throws UnsatisfiedLinkError exceptions.

I'm baffled. Any thoughts?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8903
    
    8

So you are running the small test from the command line and the packaged app from inside Eclipse? That sounds like a library path problem to me. Try printing out System.getProperty("java.library.path").


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Turns out you cannot rename the class. The functions in the C code inside the dll include the fully qualified classname:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNI program works, copy of it doesn't