Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"javaw.exe" does NOT prevent popup of black command prompt when starting GUI *.jar prgm

86 views
Skip to first unread message

Ulf Meinhardt

unread,
Dec 28, 2009, 5:06:02 AM12/28/09
to
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

unread,
Dec 28, 2009, 5:32:14 AM12/28/09
to

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

unread,
Dec 28, 2009, 6:18:06 AM12/28/09
to
Yes, you are right.
It's in a *.bat batch file

How can I prevent the popup in this case?


On Mon, 28 Dec 2009 12:32:14 +0200, Donkey Hottie <don...@fred.pp.fi>
wrote:

Lew

unread,
Dec 28, 2009, 8:17:52 AM12/28/09
to
Please do not top-post.

Ulf Meinhardt wrote:
>>> 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?

Donkey Hottie wrote:
>> 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.

Ulf Meinhardt wrote:
> 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

Arne Vajhøj

unread,
Dec 28, 2009, 10:20:16 AM12/28/09
to
On 28-12-2009 05:06, Ulf Meinhardt wrote:
> 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

Eric Sosman

unread,
Dec 28, 2009, 11:07:40 AM12/28/09
to

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
eso...@ieee-dot-org.invalid

1 connu

unread,
Jan 5, 2010, 5:33:24 AM1/5/10
to
I create a bat file with command :
start /B javaw ...
No more console !

"Ulf Meinhardt" <ul...@email.com> a �crit dans le message de news: 4b38830a$0$6572$9b4e...@newsspool4.arcor-online.net...

ship...@gmail.com

unread,
Oct 19, 2015, 7:45:20 AM10/19/15
to
Check if your JAVA_HOME is set.
javaw.bat should not be necessary if paths are set correct.
0 new messages