[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Set LD_LIBRARY_PATH in Linux

Posted on 2011-05-11
7
Medium Priority
?
893 Views
Last Modified: 2012-05-11
I have exported the LD_LIBRARY_PATH to the library where my *.so file exist but still I am getting following exception

java.lang.UnsatisfiedLinkError: no prospect_jpcam in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)

Following is the value of System.getProperty("java.library.path")
java.library.path /usr/lib/jvm/java-6-openjdk/jre/lib/i386/client:/usr/lib/jvm/java-6-openjdk/jre/lib/i386:/usr/lib/jvm/java-6-openjdk/jre/../lib/i386::/usr/lib/jvm/java-6-sun:/home/administrator/cambuild:/usr/java/packages/lib/i386:/usr/lib/jni:/lib:/usr/lib

and the file prospect_jpcam.so exist in following directory  :/home/administrator/cambuild
0
Comment
Question by:MeenuNagpal
7 Comments
 
LVL 38

Expert Comment

by:wesly_chen
ID: 35742021
java -Djava.library.path=/home/administrator/cambuild ....
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 35742030
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35742528
What are you doing in your code?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 20

Expert Comment

by:Venabili
ID: 35742869
Yeah - we need to see some source code -- especially the part where you are loading your library.
0
 
LVL 92

Expert Comment

by:objects
ID: 35742917
Make sure you're calling loadLibrary() and not load(). The latter expects the actual filename, whereas the former just expects the library name
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 35742936
If you built your library with C++ this may occur. Make sure to build it with C, or to expose the lib functions with extern "C" convention or Java won't see it due to C++ name mangling.

Example:

extern "C" {

   void func1();
   void func2();

}


Google: extern "C" for explanations
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 35742953
And it needs to be a jni shared lib, you can't just load any shared lib
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html#gen
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
I have written articles previously comparing SARDU and YUMI.  I also included a couple of lines about Easy2boot (easy2boot.com).  I have now been using, and enjoying easy2boot as my sole multiboot utility for some years and realize that it deserves …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month20 days, 9 hours left to enroll

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question