Skip to Main Content

Java SE (Java Platform, Standard Edition)

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!

Basic problem with (AWT) under linux

843807Jul 28 2007 — edited Aug 1 2007
Hey guys, I'm used to programming under windows but i wanted to give it a try under linux, there are a few things that can't seem to compile well and I don't know what may be going on.
This simple code

import javax.swing.JOptionPane;

public class Exam {

public static void main(String args [])
{
JOptionPane.showMessageDialog(null, "This is a test");
}
}

will give me this error:

Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(libgcj.so.70)
at java.awt.Window.<init>(libgcj.so.70)
at java.awt.Frame.<init>(libgcj.so.70)
at java.awt.Frame.<init>(libgcj.so.70)
at javax.swing.SwingUtilities$OwnerFrame.<init>(libgcj.so.70)
at javax.swing.SwingUtilities.getOwnerFrame(libgcj.so.70)
at javax.swing.JOptionPane.<clinit>(libgcj.so.70)
at java.lang.Class.initializeClass(libgcj.so.70)
at leer.i(leer.java:51)
at american.main(american.java:12)
Caused by: java.lang.UnsatisfiedLinkError: libgtkpeer: libgtkpeer.so: cannot open shared object file: No such file or directory
at java.lang.Runtime._load(libgcj.so.70)
at java.lang.Runtime.loadLibrary(libgcj.so.70)
at java.lang.System.loadLibrary(libgcj.so.70)
at gnu.java.awt.peer.gtk.GtkToolkit.<clinit>(libgcj.so.70)
at java.lang.Class.initializeClass(libgcj.so.70)
at java.lang.Class.forName(libgcj.so.70)
at java.awt.Toolkit.getDefaultToolkit(libgcj.so.70)
...10 more

btw, error that i dont get when running it under windows, anyone can help? thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2007
Added on Jul 28 2007
1 comment
122 views