Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2003

Tip: Looking for answers? Try searching our database.

Problem with java.library.path

Thread view: 
Aaron Boxer - 31 Oct 2003 21:08 GMT
Hello,

I am working with JDK 1.4.2 on windows 2000.

I have a JNI dll in the folder c:\src\bin

So, I make the following call:

java -classpath MyClassPath -Djava.library.path=c:\src\bin MyApp.app

But, the directory is ignored. and I get an Unsatisfied link error.

If I put "c:\src\bin" in the PATH, then everything is fine.

Any ideas?

Thanks.

Aaron Boxer
Steve W. Jackson - 31 Oct 2003 21:59 GMT
>:Hello,
>:
[quoted text clipped - 15 lines]
>:
>:Aaron Boxer

Some idiot once upon a time decided that Windows would use those dumb
"\" characters instead of real, regular slashes.  Since virtually every
other environment uses those for escaping special characters, and since
the value you're passing is a Java String, you likely need to escape
them by doubling them up.  But you could also save yourself some grief
if you understand how the loading of JNI libraries works.

On Windows, if you put the DLL file in the very same directory where the
launched application starts from (the directory which is returned via
the user.dir system property), there's no problem.  It's automatically
found.  On the other hand, instead of using System.loadLibrary("name"),
you could just use System.load("filename.dll") instead.  It lets you
specify the absolute or relative path without problems.

= Steve =
Signature

Steve W. Jackson
Montgomery, Alabama



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.