My application runs fine until I invoke code that uses the 3rd party
application. When I do that, I get the following:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no xyz in
java.library.path
OK, so I did some googling and I added the path to xzy.so to
Run...->Arguments-> VM aguments -Djava.library.path=/home/.../lib
However, if I run with that added, I get the following as soon as my
application runs:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no
swt-pi-gtk-3235 in java.library.path
So it appears that I need to have 2 paths in my path specification.
a) how does one specify more than one path ? (I assume that one would use
a semicolon between paths ?)
b) what path do I use for this file ? I found libswt-pi-gtk-3235.so in
/.../eclipse/configuration/org.eclipse.osgi/bundles/41/1/.cp
I changed my VM argument to be
-Djava.library.path=/.../xyz/lib;/.../eclipse/configuration/org.eclipse.osgi/bundles/41/1/.cp
but I still got the same error. What am I doing wrong ?
BTW, I have the eclipse 3.1 installation folder in my home directory (ie ~).
I also tried /.../eclipse/plugins because it has
the org.eclipse.swt.gtk.linux.x86_3.2.1.v3235.jar file in it. That didn't
work either.
FWIW, I swear this app worked without the second path in eclipse 3.1. I am
now running 3.2.1
Thanks
-Djava.library.path=/home/.../lib:/home/.../Desktop/eclipse/configuration/org.eclipse.osgi/bundles/41/1/.cp
It needed a colon, not a semicolon.
I still don't think its right having to specify the second path like that.
Should probably be a system variable or not needed at all.
On Linux, java.library.path takes a colon separated list of
directories (not semicolon).
However, depending on the relationship between the two libraries, it
may be necessary to set environment variable LD_LIBRARY_PATH instead.
It too is a colon separated list of directories.
Also, if these libraries were not written specifically for JNI, then
you can't use them anyway in your application until you write a set of
JNI wrappers.
/gordon
--
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Why should two be any different than one?
Anyway as I mentioned in my previous response, you can set
LD_LIBRARY_PATH and forget about java.library.path altogether. And if
you don't like LD_LIBRARY_PATH, you can add the directories to
/etc/ld.so.conf instead.