Forum Stats

  • 3,873,122 Users
  • 2,266,506 Discussions


DOS Window appearing

843807 Member Posts: 46,582
edited Oct 3, 2002 4:26AM in Java Desktop Applications
Hi ! I was wondering if it is possible, either by settings or through code, to make the DOS window invisible or minimized when a Java application is run. I prefer if this could be done programmatically.
Thanks for any help on this.


  • 843807
    843807 Member Posts: 46,582
    the most common way, short of an executable jar file, is to create a batch file to run the java application using the javaw command.

    Say your main class file is called Foo.class.

    You batch file is call Foo.bat, and contains the fallowing line:
    javaw Foo

    now double click on the batch file and your java application runs without the command prompt.

    *note: javaw has the same command line options/arguments as normal 'java' does.
This discussion has been closed.