Discussion:
"javaw.exe" does NOT prevent popup of black command prompt when starting GUI *.jar prgm
(too old to reply)
Ulf Meinhardt
2009-12-28 10:06:02 UTC
Permalink
I read that when I start a GUI based java program with

javaw.exe -jar myprgm.jar

instead of

java.exe -jar myprgm.jar

then NO black command prompt console window is visible/poped up (under WinXP).

This is not true!

javaw.exe shows the command prompt window as well (in addition to the actual GUI window)!!!

Is there really no way of preventing the popup of the console?

Ulf
Donkey Hottie
2009-12-28 10:32:14 UTC
Permalink
Post by Ulf Meinhardt
I read that when I start a GUI based java program with
javaw.exe -jar myprgm.jar
instead of
java.exe -jar myprgm.jar
then NO black command prompt console window is visible/poped up (under WinXP).
This is not true!
javaw.exe shows the command prompt window as well (in addition to the actual GUI window)!!!
Is there really no way of preventing the popup of the console?
Is this javaw.exe invocation in a batch file (.bat, .cmd)? If so, then
the console window will show.

It should not show up if the javaw is called directly from the shortcut.
--
http://www.iki.fi/jarif/

Love is in the offing. Be affectionate to one who adores you.
Ulf Meinhardt
2009-12-28 11:18:06 UTC
Permalink
Yes, you are right.
It's in a *.bat batch file

How can I prevent the popup in this case?
Post by Donkey Hottie
Post by Ulf Meinhardt
I read that when I start a GUI based java program with
javaw.exe -jar myprgm.jar
instead of
java.exe -jar myprgm.jar
then NO black command prompt console window is visible/poped up (under WinXP).
This is not true!
javaw.exe shows the command prompt window as well (in addition to the actual GUI window)!!!
Is there really no way of preventing the popup of the console?
Is this javaw.exe invocation in a batch file (.bat, .cmd)? If so, then
the console window will show.
It should not show up if the javaw is called directly from the shortcut.
Lew
2009-12-28 13:17:52 UTC
Permalink
Please do not top-post.
Post by Ulf Meinhardt
Post by Donkey Hottie
Post by Ulf Meinhardt
I read that when I start a GUI based java program with
javaw.exe -jar myprgm.jar
instead of
java.exe -jar myprgm.jar
then NO black command prompt console window is visible/poped up (under WinXP).
This is not true!
javaw.exe shows the command prompt window as well (in addition to the
actual GUI window)!!!
Is there really no way of preventing the popup of the console?
Is this javaw.exe invocation in a batch file (.bat, .cmd)? If so, then
the console window will show.
It should not show up if the javaw is called directly from the shortcut.
Yes, you are right.
It's in a *.bat batch file
How can I prevent the popup in this case?
I don't think you can, but this is a Windows question, not a Java question.

Are you able to arrange things so that you don't need a .bat file? By design,
JAR files are standalone distribution vehicles for Java applications and
should not need to run from script files. Just invoke javaw directly, as the
Don suggested.

You can also set up an association between javaw and the .jar extension so
that Windows will run a JAR by double-clicking on it.
--
Lew
Eric Sosman
2009-12-28 16:07:40 UTC
Permalink
Post by Lew
Please do not top-post.
Post by Ulf Meinhardt
Post by Donkey Hottie
Post by Ulf Meinhardt
I read that when I start a GUI based java program with
javaw.exe -jar myprgm.jar
instead of
java.exe -jar myprgm.jar
then NO black command prompt console window is visible/poped up (under WinXP).
This is not true!
javaw.exe shows the command prompt window as well (in addition to
the actual GUI window)!!!
Is there really no way of preventing the popup of the console?
Is this javaw.exe invocation in a batch file (.bat, .cmd)? If so,
then the console window will show.
It should not show up if the javaw is called directly from the shortcut.
Yes, you are right.
It's in a *.bat batch file
How can I prevent the popup in this case?
I don't think you can, but this is a Windows question, not a Java question.
Are you able to arrange things so that you don't need a .bat file? By
design, JAR files are standalone distribution vehicles for Java
applications and should not need to run from script files. Just invoke
javaw directly, as the Don suggested.
You can also set up an association between javaw and the .jar extension
so that Windows will run a JAR by double-clicking on it.
Stepping back a bit, the console window you see is not Java's
window but the .bat file's window. You would see it even if the
.bat file ran something not involving Java at all. That's why this
is a Windows question, not a Java question.
--
Eric Sosman
***@ieee-dot-org.invalid
Arne Vajhøj
2009-12-28 15:20:16 UTC
Permalink
Post by Ulf Meinhardt
I read that when I start a GUI based java program with
javaw.exe -jar myprgm.jar
instead of
java.exe -jar myprgm.jar
then NO black command prompt console window is visible/poped up (under WinXP).
This is not true!
javaw.exe shows the command prompt window as well (in addition to the actual GUI window)!!!
Not here.

What Java er you using and how do you activate the commands ?

Arne
1 connu
2010-01-05 10:33:24 UTC
Permalink
I create a bat file with command :
start /B javaw ...
No more console !
Post by Ulf Meinhardt
I read that when I start a GUI based java program with
javaw.exe -jar myprgm.jar
instead of
java.exe -jar myprgm.jar
then NO black command prompt console window is visible/poped up (under WinXP).
This is not true!
javaw.exe shows the command prompt window as well (in addition to the actual GUI window)!!!
Is there really no way of preventing the popup of the console?
Ulf
s***@gmail.com
2015-10-19 11:45:09 UTC
Permalink
Check if your JAVA_HOME is set.
javaw.bat should not be necessary if paths are set correct.

Loading...