File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Can we Avoid Dos Prompt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Can we Avoid Dos Prompt" Watch "Can we Avoid Dos Prompt" New topic

Can we Avoid Dos Prompt

narayana murthy pedapudi
Ranch Hand

Joined: Jul 23, 2003
Posts: 42
I want to run an application without the dos prompt, i am using some installationsheild by which i am hiding the dos prompt after it comes.
But i don't want this dos prompt should come atall, how can i achieve this, i think i must convet this to an exe. But no idea How to do it.
Please Help in this regards.

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
You can try to execute your programm with javaw instead of java.
Create a batch file and there you call your main class with javaw.
From Sun:
"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."
or you can check out this tool:
narayana murthy pedapudi
Ranch Hand

Joined: Jul 23, 2003
Posts: 42
Thanks for the information, I could know how to create EXE with that but the Problem is this didn't solve my problem, Whenever i click on the exe a dos prompt is coming, i don't want that dos prompt at all, whenever i click on the exe file my application should run without any dos prompt.
(There should not be any dos prompt in the application at any point of time)
Please Let me know any trial versions which can help me in this regards.
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
If your launcher is a .jar file the user double-clicks on, there's no prompt. If you're compiling the lancher .exe yourself, then look in your compiler's documentation for a command line option that will show or hide the console.
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
Use Javaw.exe instead of Java.exe. Javaw is as same as Java, but it starts the Application in a Window rather than in console.
Pack all your client classes in to a .jar file and write a batch file to invoke the main class in the .jar file using Javaw. This is the mechanism people follow for distributing Java Client Applications.
I agree. Here's the link:
subject: Can we Avoid Dos Prompt
It's not a secret anymore!