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]

Why wont my program run? Maybe an issue with gcj?


Hi there!

Im trying to run this program, it compiles okay with 
gcj --main=Reminder Reminder.java -o Reminder, but when I run it I get
this err.

libgcj failure: only thread already running
Aborted

Oh why can this happen ;) .. Umh I am not subscribed to this list, so
please mail me directly.


import java.util.Timer;
import java.util.TimerTask;

public class Reminder {
    Timer timer;

    public Reminder (int seconds) {
	timer = new Timer();
	timer.schedule (new RemindTask(), seconds * 1000);
    }

    class RemindTask extends TimerTask {
	public void run() {
	    System.out.println ("Time is up!");
	    timer.cancel();
	}
    }

    public static void main (String[] args) {
	new Reminder (Integer.parseInt (args[0]));
	System.out.println ("Task scheduled.");
    }

}
-- 
Martin Willemoes Hansen

--------------------------------------------------------
E-Mail	mwh@sysrq.dk	Website	mwh.sysrq.dk
IRC     MWH, openprojects	
--------------------------------------------------------               


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