M
Martin Stokland Jensen
Hi
Here is my problem. I'm currently modifying a program to run without
the GUI. It shall run on a headless system where X is not installed.
When I remove the statement that invokes the GUI, the program just
continues reading statements and exits. The GUI somehow kept the
application running.
I can make a infinite loop here like this:
boolean ever = true;
for (;ever {}
Now everything works. The program runs just fine the way I want it.
But the problem is that the only way (I know of) to terminate it, is
to kill it. I would like til to just stop wait()ing and execute the
last statements in the code.
How can I send a signal to the program? Can a seperate program do this?
I don't think any source code should be nessesary since this is a general
question, but the code looks like this:
<code>
public static void main(String[] args) {
MainWindow.instance().open();
cleanUpMethod();
System.exit(0);
}
</code>
I changed it to
<code>
public static void main(String[] args) {
boolean ever = true;
for (;ever {}
cleanUpMethod();
System.exit(0);
}
</code>
But cleanUpMethod() and System.exit(0) will never run, 'cause I kill
it to stop it.
Thanks
Martin Jensen
Here is my problem. I'm currently modifying a program to run without
the GUI. It shall run on a headless system where X is not installed.
When I remove the statement that invokes the GUI, the program just
continues reading statements and exits. The GUI somehow kept the
application running.
I can make a infinite loop here like this:
boolean ever = true;
for (;ever {}
Now everything works. The program runs just fine the way I want it.
But the problem is that the only way (I know of) to terminate it, is
to kill it. I would like til to just stop wait()ing and execute the
last statements in the code.
How can I send a signal to the program? Can a seperate program do this?
I don't think any source code should be nessesary since this is a general
question, but the code looks like this:
<code>
public static void main(String[] args) {
MainWindow.instance().open();
cleanUpMethod();
System.exit(0);
}
</code>
I changed it to
<code>
public static void main(String[] args) {
boolean ever = true;
for (;ever {}
cleanUpMethod();
System.exit(0);
}
</code>
But cleanUpMethod() and System.exit(0) will never run, 'cause I kill
it to stop it.
Thanks
Martin Jensen