Re: [Java-gnome-developer] Executing examples
Brought to you by:
afcowie
From: Hurlin <sm...@in...> - 2004-10-11 23:10:05
|
On Monday 11 October 2004 23:42, Rishabh Manocha wrote: It did not work :-/ Here is what i do smelc$ CLASSPATH=3D/usr/share/java/gnome2.6.jar:/usr/share/java/gtk2.4.jar smelc$ LD_LIBRARY_PATH=3D/usr/lib/jni smelc$ export CLASSPATH smelc$ export LD_LIBRARY_PATH I check with 'export' : declare -x LD_LIBRARY_PATH=3D"/usr/lib/jni" declare -x CLASSPATH=3D"/usr/share/java/gnome2.6.jar:/usr/share/java/gtk2.4= =2Ejar" Then it seems to works because i can compile without -classpath flag yet=20 execution still fails :O\ smelc$ javac First.java smelc$ java First Exception in thread "main" java.lang.NoClassDefFoundError: First > you need to export the classpath and the LD_LIBRARY_PATH. > after: > smelc$ CLASSPATH=3D/usr/share/java/gtk2.4.jar:/usr/share/java/gnome2.6.jar > > you need to do: > export CLASSPATH and the same with the LD_LIBRARY_PATH. > May I suggest adding these two to your .bashrc/.profile so that you > dont need to do this for every new session. > > --Rishabh > > On Mon, 11 Oct 2004 23:20:25 +0200, Hurlin Cl=E9ment <sm...@in...> wro= te: > > I tried to set both classpath and location of native part of the > > libraries but it didn't work : > > > > smelc$ CLASSPATH=3D/usr/share/java/gtk2.4.jar:/usr/share/java/gnome2.6.= jar > > smelc$ javac First.java > > smelc$ LD_LIBRAY_PATH=3D/usr/lib/jni/ > > smelc$ java First > > Exception in thread "main" java.lang.NoClassDefFoundError: First > > smelc$ java -Djava.library.path=3D/usr/li/jni First > > Exception in thread "main" java.lang.NoClassDefFoundError: First > > > > And i think, i have all the files required : > > > > smelc$ ls /usr/lib/jni/ > > > > libgconfjar2.6.so libgnomejava2.6.so.2.6.0 =20 > > libgtkjava2.4.so libgconfjar2.6.so.2.6.0 libgnomevtejar0.11.so > > libgtkjava2.4.so.2.4.0 > > libgconfjava2.6.so libgnomevtejar0.11.so.0.11.10 libqtjava.la > > libgconfjava2.6.so.2.6.0 libgnomevtejava0.11.so libqtjava.so > > libgladejar2.6.so libgnomevtejava0.11.so.0.11.10 libqtjava.so.1 > > libgladejar2.6.so.2.6.0 libgtkhtmljar2.6.so =20 > > libqtjava.so.1.0.0 libgladejava2.6.so libgtkhtmljar2.6.so.2.6.0 = =20 > > libswt-gtk-2136.so libgladejava2.6.so.2.6.0 libgtkhtmljava2.6.so > > libswt-pi-gtk-2136.so > > libgnomejar2.6.so libgtkhtmljava2.6.so.2.6.0 libxmlj-0.99.= so > > libgnomejar2.6.so.2.6.0 libgtkjar2.4.so libxmlj.so > > libgnomejava2.6.so libgtkjar2.4.so.2.4.0 > > > > :-/ > > : > > > On Mon, Oct 11, 2004 at 07:44:58PM +0200, Hurlin Cl?ment wrote: > > > > java -Djava.library.path=3D/usr/lib/jni/ First > > > > > > > > Exception in thread "main" java.lang.NoClassDefFoundError: > > > > org/gnu/gnome/Program > > > > at First.main(First.java:10) > > > > > > This is caused by not having the gnome jar in your classpath. You need > > > both the classpath set correctly so java finds the java libraries and > > > the LD_LIBRARY_PATH (-D) setting so that they can find the native part > > > of the libraries. > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > > Use IT products in your business? Tell us what you think of them. Give = us > > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out > > more http://productguide.itmanagersjournal.com/guidepromo.tmpl > > _______________________________________________ > > java-gnome-developer mailing list > > jav...@li... > > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer |