Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compiler and Tools Not Working

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I downloaded some compilers and tools. Whenever I open the EXE files, the DOS window shows up, some writing shows up for a nanosecond, and then the program just automatically terminates and it closes down itself. I can't even see what it says. Any idea what might be wrong?
 
It sounds like you're running your program from inside an IDE. Your program may be error-free, but the DOS window quickly disappears because the lifetime of your program is so short.

You can do as jnicho suggested and go to a DOS prompt (if you're on Windows, go to Start->Programs->MS-DOS Prompt) and execute your program from the command line.

Another thing you can do is make your program sleep before terminating so that you have time to look at its output:

public class Class1 implements Runnable
{
private Thread t;
public void run(){}

private void wait_for_me_to_see_output()
{
t=new Thread(this);
t.start();

try {
t.sleep(5000);
} catch (InterruptedException e) {}
}
public static void main (String[] args)
{
Class1 c1=new Class1();
// Insert relevant program stuff here
System.out.println("testing...");
c1.wait_for_me_to_see_output();
}
} [sig]<p>Russ<br><a href=mailto:bobbitts@hotmail.com>bobbitts@hotmail.com</a><br><a href= is in</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top