aspose file tools*
The moose likes Java in General and the fly likes Hpw to load System Library Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Hpw to load System Library" Watch "Hpw to load System Library" New topic
Author

Hpw to load System Library

An Sush
Ranch Hand

Joined: Jan 17, 2007
Posts: 47
Hi All,
What does the following line of code means?

Does it load some system library or native code?
Wat is test in the above code? some dll file? (on windows) and is there no need to mention the file extension?
Shd i have this dll (or whatever file ext) places in my classpath while executing the java class? or is there some other mechanism?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14430
    
  23

That line of code loads a native library. What the exact filename of the library is depends on the operating system your run it on - on Windows, it would be test.dll, on Linux, it would be libtest.so, for example.

Java uses the variable java.library.path to look for native libraries (it does not use the class path!). You can set that variable on the command line when you start your program, like this:

java -Djava.library.path=<directory that contains the native lib> com.mypackage.MyProgram

Look at the API documentation of the method System.loadLibrary(...) for details.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19784
    
  20

An Sush wrote:Shd

Please http://faq.javaranch.com/java/UseRealWords


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
An Sush
Ranch Hand

Joined: Jan 17, 2007
Posts: 47


I appreciate the Forum's initiative to promote usage of real words and avoid short forms..
But policing this way is no way out..I am sure you will find better work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hpw to load System Library