Re: [Java-gnome-developer] Problems running programs
Brought to you by:
afcowie
From: Jeff M. <ku...@gm...> - 2005-03-08 13:15:42
|
On Tue, 08 Mar 2005 14:08:06 +0100, Bruno Dusausoy <bdu...@be...> wrote: > My CLASSPATH is as follows : > > bdusauso@Tu-144:~/workspace/First$ echo $CLASSPATH > /usr/lib/j2se/1.4/jre/lib/rt.jar:/usr/share/java:. > ... > It seems javac don't find the packages, but my parameters (CLASSPATH > especially) are right, no ? The problem here is that the Java-GNOME libraries are not in your classpath. You need to add the gtk and gnome jar files to your classpath in order to compile this example. > But, when running, Eclipse tells me : > > Exception in thread "main" > java.lang.UnsatisfiedLinkError: /usr/lib/jni/libgnomejava2.8.so.2.8.2: > libgtkjava2.4.so: cannot open shared object file: No such file or > directory > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1511) > at java.lang.Runtime.loadLibrary0(Runtime.java:788) > at java.lang.System.loadLibrary(System.java:834) > at org.gnu.gnome.Program.<clinit>(Program.java:74) > at First.main(First.java:22) > > I'm sure i'm doing all things the wrong way, but I don't know how to do > it right :) > Is there a good soul who can help me ? > There is a simple solution for this issue as well. The example cannot find the Java-GNOME shared objects to load them at runtime. You can resolve this by either adding the path to the shared objects to your LD_LIBRARY_PATH env variable or you can specify -Djava.library.path=/usr/lib/jni as a VM argument. This VM argument is set up in the run dialog of eclipse by selecting the Arguments tab. -- Jeffrey Morgan "The highest reward for a man's toil is not what he gets for it, but what he becomes by it" - Jon Ruskin |