Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
neil harman
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic