• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DOS window still coming when I run the Application using javaw

 
Rajasekaran Anand
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running xindice using javaw but ,it is still showing the DOS window.Can any body tell me how can I come over it..
 
Rajasekaran Venkadasalam
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello do you know why javaw is used for...it is used to open the executable jar file.
please study the documentation..if you dont have doc please refer me..Okay
:-)
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you tried adding 'start'?
as in:
start javaw my.App
I don't actually care enough to go find out the diffence, but this is what i generally do.
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I've been avoiding this one but start doesn't work either. I tried writing a small java boot program that used "start java prog" but it threw an exception in Win32Process. I even tried writing a C++ boot program to do the same thing using CreateProcess and it just sat there looking stupid: the java VM never started. The only other possibility I can think of is to write a C++ program and use spawn and then cut the parent loose from the child and then have the parent exit.
Boy some things are so much easier to do in Unix/Linux!
Michael Morris
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I was lazy and didn't state that I believe 'start' only works in NT/2k/XP.
I know it works in some cases and these are the only ones I've tested it in.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I am a bit confused. How are you running javaw xindice in the first place? From a batch file? I don't think that javaw is intended to get rid of the DOS screen as in it does not appear. I know that when you launch a java program using javaw from the DOS prompt, then you can close that DOS prompt without terminating the java application. It is the same as saying:
java xindice &
in linux. It runs the app as a seperate process from the DOS window.
Now, I have noticed that when running a batch file that uses javaw, in Windows 95, the DOS window opens then closes almost immediatly. But on Windows XP the DOS window stays open and I just have to close it.
Have not tested on other OS's.
[ August 08, 2002: Message edited by: Gregg Bolinger ]
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,
I'm using Win 2k Pro. Can't get rid of the damn command window no matter what I try. Batch files, boot programs, start, javaw, whatever. Another big problem with this is that just closing the command window will kill the VM that it owns without notifying it. So you can't prevent a user from shutting down, possibly leaving your program in a state of disarray. I hope someone comes up with a solution for this.
Michael Morris
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Morris:
Hi David,
Another big problem with this is that just closing the command window will kill the VM that it owns without notifying it. So you can't prevent a user from shutting down, possibly leaving your program in a state of disarray.
Michael Morris

This is not true if you use JAVAW to launch you application.
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I just tried using "javaw" and my java boot program does work using "javaw" instead of "start java" but as Greg indicated on NT Kernal machines you have to manually close the command box.
Here's the boot program:

Of course it wouldn't be too dificult to pass the class file and any parameters for it in main's args, instead of a hardwiring it.
Michael Morris
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic