Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNI program works, copy of it doesn't

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Joe Ess
Bartender
Posts: 9300
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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").
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Turns out you cannot rename the class. The functions in the C code inside the dll include the fully qualified classname:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic