Re: [Java-gnome-developer] Executing examples
Brought to you by:
afcowie
From: Luca De R. <pie...@fa...> - 2004-10-11 23:52:21
|
You need to add your current work directory to the classpath (as in other java apps). export CLASSPATH=3D.:/usr/share/java/gnome2.6.jar:/usr/share/java/gtk2.4.= jar Mark this should be in the HintsAndTips section. > On Monday 11 October 2004 23:42, Rishabh Manocha wrote: >=20 > It did not work :-/ > Here is what i do >=20 > 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 >=20 > I check with 'export' : >=20 > declare -x LD_LIBRARY_PATH=3D"/usr/lib/jni" > declare -x CLASSPATH=3D"/usr/share/java/gnome2.6.jar:/usr/share/java/gt= k2.4.jar" >=20 > Then it seems to works because i can compile without -classpath flag ye= t=20 > execution still fails :O\ >=20 > smelc$ javac First.java > smelc$ java First > Exception in thread "main" java.lang.NoClassDefFoundError: First >=20 >=20 >=20 > > 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=C3=A9ment <smelc@inbox.= lv> wrote: > > > 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/gnome= 2.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.s= o > > > 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.s= o > > > 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 ITManagersJo= urnal > > > Use IT products in your business? Tell us what you think of them. G= ive 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 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJourna= l > 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 --=20 Luca De Rugeriis <pie...@fa...> |