This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Executing Gcj-SWT native code fails


Hi guys,

I actually work on a SWT GUI I want to be compiled natively with gcj.
My concern is that when I launch the binary generated by gcj, no window is visible,
however my program still run and give me the basic debug message like ("Hello").


If somebody already encountred this problem... some help will be very appreciate:

Here is my sample code:

import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;

public class Test {
   public static void main(String[] args){
       Display display = new Display();
       Shell shell = new Shell(display);
       shell.setText("Hello World");
       shell.setSize(200,100);
       shell.open ();
       while (!shell.isDisposed()) {
           if (!display.readAndDispatch())
               display.sleep ();
       }
       display.dispose ();
   }
}


And my Makefile: gcj -c -Wall -I./lib/swt.jar --classpath=src/ src/Test.java #Linking all gcj --main=Test Test.o -lswt -lswt-pi -o Test

I've tested gcj-3.3 and gcj-3.4 on a debian sid. As my GUI source code, this small example doesn't work!


Regards.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]