HOWTO: Stop Output Window from Closing After Running Jview.exeID: Q169798
|
When you run a Java Application using Jview.exe from within the Developer Studio IDE, the MS-DOS Command Prompt Window closes immediately after the Java Application terminates. This article illustrates how to programmatically prevent the MS-DOS Window from closing immediately.
To prevent the MS-DOS Window from closing immediately, you can have an
input statement as the last statement in your Java application. For
example:
public class Hello1
{
public static void main(String args[]) throws java.io.IOException
{
System.out.println("Hello, World!");
System.in.read();
}
}
public class Hello2
{
public static void main(String args[])
{
System.out.println("Hello, World!");
try { System.in.read(); } catch(Exception e) {};
}
}
JView myClass
For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java,
please see the following pages on the Microsoft Technical Support site:
http://support.microsoft.com/support/visualj/
http://support.microsoft.com/support/java/
Additional query words:
Keywords : kbVJ100 kbVJ110
Version : WINDOWS:1.0,1.1
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 6, 1999