This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Why wont my program run? Maybe an issue with gcj?
- From: Martin Willemoes Hansen <mwh at sysrq dot dk>
- To: java at gcc dot gnu dot org
- Date: 04 Jan 2002 12:32:41 +0100
- Subject: 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
--------------------------------------------------------