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)

mdentya at 2007-7-12 9:30:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
thanks
Aldricha at 2007-7-12 9:30:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
Exception in thread "main" java.lang.UnsatisfiedLinkError: /apps/test/TestCryptor/Simple/TestDll_1.so: /apps/test/TestCryptor/Simple/TestDll_1.so: only ET_DYN and ET_EXEC can be loadedwhat does this mean?
Aldricha at 2007-7-12 9:30:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 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)
mdentya at 2007-7-12 9:30:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...