aspose file tools*
The moose likes Java in General and the fly likes Need hel;p: How to close a batch script from a java app. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need hel;p: How to close a batch script from a java app." Watch "Need hel;p: How to close a batch script from a java app." New topic
Author

Need hel;p: How to close a batch script from a java app.

neil harman
Greenhorn

Joined: Oct 20, 2003
Posts: 1
A client of mine has a problem, they have a batch script ( see below) that launches an app ( abc.exe ) then a series of jars, and finally java app ( java.Application ).
Problem is that when they exit the abc.exe, the batch script does not close unless the Ctrl C and say Yes to end batch job.
Does anyone have any ideas how to overcome this?
batch script follows :
:BEGIN
start /d "c:\Program files\abc" /b abc.exe
C:\j2sdk1.4.2_01\bin\java -classpath class_path=".;
C:\Program Files\abc\abc\src;
C:\Program Files\abc\abc\lib\mail.jar;
C:\Program Files\abc\abc\lib\activation.jar;
C:\Program Files\abc\abc\lib\ftpbean.jar" java.Application
:END
Thanks
neil
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I was going to suggest putting EXIT at the end of the batch file, but if you have to Ctrl-C to break something, it'll never get to the EXIT either. Something that is being started in those jars must have threads that never end, or at least not in the time you're willing to wait. Do these things all talk to each other? Sockets or something? You might have to coordinate shut-down between them all. Can you get them all into one JVM with a driver that starts all the other things and shuts down the VM clean at end?
[ October 20, 2003: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need hel;p: How to close a batch script from a java app.