Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Swing on Linux

843785Mar 4 2009 — edited Mar 4 2009
Hello -

I am new to Java programming. I have installed Java version 1.6 on both my Windows Vista and Linux operating systems. It works fine on Windows Vista. On Red Hat Linux version 4.2.1.6 with Gnome v 2.8 ( I think ) the "Hello Java" program works fine, but when I try to use Swing classes I get an error.

I am able to compile the java code using javac, but running it in terminal I get the following runtime error message



Exception in thread "GtkMain" java.lang.UnsatisfiedLinkError: gtkInit
at JvLookupJNIMethod (/usr/lib64/libgcj.so.5.0.0)
at JvJNIMethod.call(ffi_cif, void, ffi_raw, void) (/usr/lib64/libgcj.so.5.0.0)
at gnu.java.awt.peer.gtk.GtkMainThread.run() (Unknown Source)
at java.lang.Thread.run() (/usr/lib64/libgcj.so.5.0.0)
at JvThreadRun(java.lang.Thread) (/usr/lib64/libgcj.so.5.0.0)
at GC_start_routine (/usr/lib64/libgcj.so.5.0.0)
at __clone (/lib64/tls/libc-2.3.4.so)


I figure that there is something I am not doing correctly in Linux
How should I try to run java programs with swing components?
Through the terminal? Run from the command

Did I install a version of Java that my linux operating system does not support
Or perhaps it is gnome that does not support this version.

Are there some properties/environment variables that I need to include in my profile in order to run a gui java program?

I looked in the O'Reilly Learning Java book but their demonstration of Swing was run from a Windows command line.

Thank you for any help you can provide.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2009
Added on Mar 4 2009
1 comment
354 views