Re: [Java-gnome-developer] Executing examples
Brought to you by:
afcowie
From: Rishabh M. <rma...@gm...> - 2004-10-11 23:55:59
|
Just as an example, here is the First.java File I have. Hope this one works for you. On Tue, 12 Oct 2004 01:52:03 +0200, Luca De Rugeriis <pie...@fa...> wrote: > 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 >=20 > Mark this should be in the HintsAndTips section. >=20 >=20 >=20 > > 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/gt= k2.4.jar" > > > > Then it seems to works because i can compile without -classpath flag ye= t > > 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...>= 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 > > > > 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 > > > > libqtjava.so.1.0.0 libgladejava2.6.so libgtkhtmljar2.6.so.2.= 6.0 > > > > 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 > > ------------------------------------------------------- > > 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 > -- > Luca De Rugeriis <pie...@fa...> >=20 >=20 >=20 >=20 > ------------------------------------------------------- > 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 mo= re > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer > |