loading .so without access to /usr/lib
Good day to you all,i have created a test.so, but i cant write to /usr/lib. how could i use/load test.so without putting it inside /usr/lib folder.Thanks,AldrichNoob java programmer
[216 byte] By [
Aldricha] at [2007-11-27 4:23:13]

# 1
Hi,
You can use System.load("~/path/to/libTest.so");
Please see : http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#load(java.lang.String)
Note that the String argument must be absolute path.
So if your lib is in ../lib do :
System.load(new File("../lib/libTest.so").getCanonicalPath());
Regards,
--Marc (http://jnative.sf.net)
# 4
I think your C compiler/linker options for a shared library are not correct.Do you use gcc ?if so, add -shared option in the linking command line.Regards,--Marc ( http://jnative.sf.net)