loading libjvm.so and LD_LIBRARY_PATH

loading libjvm.so and LD_LIBRARY_PATH

Post by Naresh Aga » Fri, 01 Jul 2005 20:18:50


I'm writing a program to use JNI Invocation APIs on linux/solaris,
i.e., calling a Java program from C/C++.

I'm dynamically loading the JVM library and then calling
"JNI_CreateJavaVM" function after getting the symbol. I'm providing the
*full path* the libjvm.so to be loaded.

Now after specifying the full path of libjvm.so, do we need to specify
any thing extra in LD_LIBRARY_PATH (i.e., location of any other
libraries, which may be loaded by libjvm.so)?

Is there any documentation/guideline for setting the LD_LIBRARY_PATH
while loading libjvm.so and creating VM


1. Crash in CreateJavaVM after loding libjvm.so(jre1.4) from C app dynamically...

2. Python,SWIG and libjvm

I'm not sure if this the correct list but here goes (and sorry for the
noise). I've been attempting to wrap python around libhdfs.
So far so good (i've attached the SWIG template at the end). The
compilation works without errors and the shared objects do have
references to all the functions.

However, when importing into python

import pyhdfs

i get the following error:

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/home/sguha/tmp/b/hdfs.py", line 7, in ?
import _hdfs
ImportError: libjvm.so: cannot open shared object file: No such file
or directory

However, libjvm.so is located in /home/sguha/mine/jdk1.6.0_02/jre/lib/
amd64/server which is present in the PYTHONPATH and sys.path.
I can understand it complaining <i>while</i> loading the libjvm.so
but python doesn't locate it even when in the path.

As an aside, the build command for hdfs.c has " -ljvm " - this
should affect SWIG, right? Meaning if my program (e.g) links to a
library and i want a wrapper around my program (to python) i need SWIG
templates for my headers only and not for the linked library...right?
( I guess the answer is i dont otherwise that would be quite a
nightmare of work)

Thank you for your time

SWIG template
%module pyhdfs

#include "hdfs.h"

%include "hdfs.h"

3. 3 ANDS + 1 OR

4. multiple ifs ands & indirect or offset?

5. SUMPRODUCT with AND's and OR's?

6. Nesting IF's and AND's - a bit of help please...

7. WMP11 BUG: Advanced Search doesn't work with ANDs

8. Omnipage 14 ands its PDFs

9. Conditional ANDS!

10. Need help sorting out ANDs and ORs in parameter query

11. Multiple ANDs

12. Conditional Statement with ANDs

13. IF's & AND's

14. if & ands and either indirect or offset - need help fast pleas

15. multiple ifs & ands indirect/offset...need help desperately pl