burntblark
burntblark

Reputation: 1700

How do I get the contents of the library in Java?

How do I check the contents of a native library. I have gone this far:

try {
    System.load("/path/to/my/native/libraries/library.so");
} catch (UnsatisfiedLinkError e) {
    System.err.println("Native code library failed to load.\n" + e);
}

What is left for me is to start using the library right? Thus the question, how do I get the contents of the library?

More Info: Language: Java OS: Ubuntu 10.04, Linux

Thanks in anticipation.

Upvotes: 1

Views: 158

Answers (2)

Joachim Sauer
Joachim Sauer

Reputation: 308149

JNA provides an easier way to use libraries that where not built for JNI (with JNI you always need some Java-specific code).

Upvotes: 2

user473395
user473395

Reputation:

You might want to take a look at the Java Native Interface (JNI). It facilitates access to native code from Java. You may want to take a look at "The Java Native Interface Programmer's Guide and Specification" to get started.

Upvotes: 2

Related Questions