This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Hpw to load System Library  RSS feed

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Java Cowboy
Sheriff
Posts: 16084
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 21452
95
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

An Sush wrote:Shd


Please http://faq.javaranch.com/java/UseRealWords
 
An Sush
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Prime wrote:
Please http://faq.javaranch.com/java/UseRealWords



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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!