Search code examples
javawinapiconsole

Is there a way to the hide win32 launch console from a Java program (if possible without JNI)


You launch a java program from a console (maybe using a .bat script). I don't want the console to remain visible, I want to hide it.

Is there a simple way to do this ? Without JNI ?


Solution

  • Use javaw.

    http://java.sun.com/javase/6/docs/tooldocs/windows/java.html

    The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.