gcj: Cannot load AWT toolkit

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

gcj: Cannot load AWT toolkit

leledumbo

Main.java:
import javax.swing.*;

public class Main extends JFrame {
  public Main() {
    super("JFrame test");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setBounds(192,144,640,480);
    setVisible(true);
  }

  public static void main(String[] args){
    Main m = new Main();
  }
}

Compiled with:
gcj -static-libgcj --main=Main -o Main Main.java

When executed:
Exception in thread "main" java.awt.AWTError: Cannot load AWT toolkit:
   at
java.awt.Toolkit.getDefaultToolkit(libjava/../../../../../gcc-4.4.0/libjav
a/classpath/java/awt/Toolkit.java:607)
   at
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(libjava/../../../
../../gcc-4.4.0/libjava/classpath/java/awt/GraphicsEnvironment.java:103)
   at
java.awt.Window.<init>(libjava/../../../../../gcc-4.4.0/libjava/classpath/
java/awt/Window.java:133)
   at
java.awt.Frame.<init>(libjava/../../../../../gcc-4.4.0/libjava/classpath/j
ava/awt/Frame.java:246)
   at
javax.swing.JFrame.<init>(libjava/../../../../../gcc-4.4.0/libjava/classpa
th/javax/swing/JFrame.java:125)
   at Main.<init>(reclaim.c:0)
   at Main.main(reclaim.c:0)
Caused by: java.lang.ClassNotFoundException:
   at
java.lang.Class.forName(libjava/../../../gcc-4.4.0/libjava/java/lang/natCl
ass.cc:101)
   at
java.awt.Toolkit.getDefaultToolkit(libjava/../../../../../gcc-4.4.0/libjav
a/classpath/java/awt/Toolkit.java:583)
   ...6 more

--
View this message in context: http://www.nabble.com/gcj%3A-Cannot-load-AWT-toolkit-tp24673668p24673668.html
Sent from the MinGW - User mailing list archive at Nabble.com.


------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users