Thread: [Java-gnome-developer] Strange problem...
Brought to you by:
afcowie
|
From: [A]ndy80 - A. G. <an...@pt...> - 2002-05-11 18:41:57
|
I've installed java-gnome 0.7.1 and I've tried this simple piece of
code:
// First we import the libraries used by this example=20
import gnu.gtk.*;=20
import gnu.gnome.*;=20
public class First=20
{=20
public static void main(String[] args)=20
{=20
// Initialization=20
Gnome.init("First", "0.1", args.length, args);=20
GnomeApp app =3D new GnomeApp("First", "First App");=20
app.setPolicy(false, true, false);=20
app.setWmclass("First", "FirstApp");=20
app.show();=20
Gtk.main();=20
}=20
}
After: javac First.java (I get NO errors)
I do: java First
and I get:
[shady@piccoli java]$ java First
Exception in thread "main" java.lang.UnsatisfiedLinkError: no GTKJava in
java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1410)
at java.lang.Runtime.loadLibrary0(Runtime.java:772)
at java.lang.System.loadLibrary(System.java:832)
at gnu.gnome.Gnome.<clinit>(Gnome.java:35)
at First.main(First.java:9)
then I try:
[shady@piccoli java]$ java -cp /usr/local/share/java-gnome/ First
Exception in thread "main" java.lang.NoClassDefFoundError: First
what could be the reason?
Some usefull info for you:
[shady@piccoli java]$ which java
/usr/java/j2sdk1.4.0/bin/java
[shady@piccoli java]$ java -version
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
SUN JDK 1.4.0 for Linux
[shady@piccoli java]$ echo $PATH
/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/games:/opt/gnome/bin:/usr/X1=
1R6/bin:/usr/java/j2sdk1.4.0/bin/:/home/shady/bin:/usr/java/j2sdk1.4.0/bin/=
:/home/shady/bin
--=20
~ Piccoli Software
=B0 =B0 http://www.piccolisoftware.cjb.net
/V\ pic...@pe...
// \\
/( )\ [A]ndy80 on #bluvertigo e #pistoia
^`~'^ an...@pt... - http://www.ptlug.org
GPG Key: http://www.ptlug.org/andy80_key.asc
|
|
From: Jeffrey M. <ku...@zo...> - 2002-05-11 23:50:50
|
The reason you are having the problem described below is because the java-gnome shared objects cannot be found and thereby loaded by the jvm. The files are located in the lib directory of the java-gnome distribution. There are two ways you can solve this problem. The easiest is to make sure the directory of these files is in your LD_LIBRARY_PATH. For example, if they are located in /usr/local/share/java-gnome/lib you can define an environment variable like the following: export LD_LIBRARY_PATH=/usr/local/share/java-gnome/lib Another way to solve this problem is to provide the path to the library to the jvm directly. You could type: java -Djava.library.path=/usr/local/share/java-gnome/lib myclass Please let me know if this solves your problem. -Jeff On Sat, 2002-05-11 at 14:30, [A]ndy80 - Andrea Grandi wrote: > After: javac First.java (I get NO errors) > I do: java First > and I get: > > [shady@piccoli java]$ java First > Exception in thread "main" java.lang.UnsatisfiedLinkError: no GTKJava in > java.library.path > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1410) > at java.lang.Runtime.loadLibrary0(Runtime.java:772) > at java.lang.System.loadLibrary(System.java:832) > at gnu.gnome.Gnome.<clinit>(Gnome.java:35) > at First.main(First.java:9) > > then I try: > > [shady@piccoli java]$ java -cp /usr/local/share/java-gnome/ First > Exception in thread "main" java.lang.NoClassDefFoundError: First > > what could be the reason? |
|
From: Jeffrey M. <ku...@zo...> - 2002-05-12 12:28:09
|
It is possible to put it into the /etc/profile file. Perhaps a more appropriate location would be the ~/.bash_profile file for each user. One other thing, if the shared objects are located in the normal library search path (for example /usr/lib, etc) there will be no need to define this variable. -Jeff On Sat, 2002-05-11 at 20:02, [A]ndy80 - Andrea Grandi wrote: > Hi >=20 > > export LD_LIBRARY_PATH=3D/usr/local/share/java-gnome/lib >=20 > it solved my problem, thank you :) > Is there a way to set that variable permanent? I mean... when I reboot I > lost that setting. Should I put that line in /etc/profile ? >=20 > --=20 > ~ Piccoli Software > =B0 =B0 http://www.piccolisoftware.cjb.net > /V\ pic...@pe... > // \\ > /( )\ [A]ndy80 on #bluvertigo e #pistoia > ^`~'^ an...@pt... - http://www.ptlug.org >=20 > GPG Key: http://www.ptlug.org/andy80_key.asc >=20 >=20 |
|
From: Fernando L. <fer...@lo...> - 2002-05-13 01:12:07
|
Hi there, It's availabe on Brazil the book "Java em GNU/Linux", a book about using Free Software to develop using the Java programming language. Maybe you'll like to put a link on the java-gome page at SourceForge. Portuguese only, until I can find a publisher on the US. :-) The book assumes a very basic knowledge of Java and starts teaching how to install a Java SDK, then how to use SciTE, DDD, GVD, Make and CVS to build a productive development environment. When it talks about GUI develpoment it uses NetBeans and later it talks about Java and native code, where it teaches to use gcj and java-gnome, and the latest chapters are about JDBC (using MySQL and PostgreSQL) and web development (using Apache JServ, GNU JSP and Apache Tomcat). Some sample applications are developed using both swing and GTK+, using both a "standard" (proprietary) JDK and gcj, and using both GUI and web interfaces, so the reader can compare raw performance, ease of programming and different coding styles. The book is availabe from http://www.altabooks.com.br/livro.asp?codigo=85-88745-25-9 The sampe programs are licensed under the LGPL (I tried to use a free publication license for the book contents also, but the local market is too small for a publish to try this). The samples can be downloaded from http://www.altabooks.com.br/downloads/java-lin.zip I think this is an important step for the free software community, because there's lack of books about development using free software, specially from an information systems perspective. I hope all of you who can speack portuguese can read my book and send me feedback, and I hope my book can help corporations apreciate the value of free software. []s, Fernando Lozano |
|
From: Marshall C. <mar...@ar...> - 2002-05-11 20:14:39
|
Try java -cp /usr/local/share/java-gnome/:. First
On Sat, 2002-05-11 at 14:30, [A]ndy80 - Andrea Grandi wrote:
> I've installed java-gnome 0.7.1 and I've tried this simple piece of
> code:
>=20
> // First we import the libraries used by this example=20
> import gnu.gtk.*;=20
> import gnu.gnome.*;=20
> public class First=20
> {=20
> public static void main(String[] args)=20
> {=20
> // Initialization=20
> Gnome.init("First", "0.1", args.length, args);=20
> GnomeApp app =3D new GnomeApp("First", "First App");=20
> app.setPolicy(false, true, false);=20
> app.setWmclass("First", "FirstApp");=20
> app.show();=20
> Gtk.main();=20
> }=20
> }
>=20
> After: javac First.java (I get NO errors)
> I do: java First
> and I get:
>=20
> [shady@piccoli java]$ java First
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no GTKJava in
> java.library.path
> at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1410)
> at java.lang.Runtime.loadLibrary0(Runtime.java:772)
> at java.lang.System.loadLibrary(System.java:832)
> at gnu.gnome.Gnome.<clinit>(Gnome.java:35)
> at First.main(First.java:9)
>=20
> then I try:
>=20
> [shady@piccoli java]$ java -cp /usr/local/share/java-gnome/ First
> Exception in thread "main" java.lang.NoClassDefFoundError: First
>=20
> what could be the reason?
>=20
> Some usefull info for you:
>=20
> [shady@piccoli java]$ which java
> /usr/java/j2sdk1.4.0/bin/java
>=20
> [shady@piccoli java]$ java -version
> java version "1.4.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
> Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
>=20
> SUN JDK 1.4.0 for Linux
>=20
> [shady@piccoli java]$ echo $PATH
> /bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/games:/opt/gnome/bin:/usr/=
X11R6/bin:/usr/java/j2sdk1.4.0/bin/:/home/shady/bin:/usr/java/j2sdk1.4.0/bi=
n/:/home/shady/bin
>=20
>=20
> --=20
> ~ Piccoli Software
> =B0 =B0 http://www.piccolisoftware.cjb.net
> /V\ pic...@pe...
> // \\
> /( )\ [A]ndy80 on #bluvertigo e #pistoia
> ^`~'^ an...@pt... - http://www.ptlug.org
>=20
> GPG Key: http://www.ptlug.org/andy80_key.asc
>=20
>=20
> _______________________________________________________________
>=20
> Have big pipes? SourceForge.net is looking for download mirrors. We suppl=
y
> the hardware. You get the recognition. Email Us: ban...@so...=
t
> _______________________________________________
> java-gnome-developer mailing list
> jav...@li...
> https://lists.sourceforge.net/lists/listinfo/java-gnome-developer
>=20
|
|
From: [A]ndy80 - A. G. <an...@pt...> - 2002-05-11 21:12:32
|
Hi > Try java -cp /usr/local/share/java-gnome/:. First I get same error: [shady@piccoli mp3]$ java -cp /usr/local/share/java-gnome/:. First Exception in thread "main" java.lang.NoClassDefFoundError: First --=20 ~ Piccoli Software =B0 =B0 http://www.piccolisoftware.cjb.net /V\ pic...@pe... // \\ /( )\ [A]ndy80 on #bluvertigo e #pistoia ^`~'^ an...@pt... - http://www.ptlug.org GPG Key: http://www.ptlug.org/andy80_key.asc |