1

I am executing a bat file from java (batch file executes another java app) Now, how can i make sure that batch executed and triggered the another java app.

IS there any way to tell that another java app started successfully.

1
  • Do you have control over source for both apps ? Commented Aug 15, 2010 at 17:19

2 Answers 2

1

I'd suggest running the other application directly from Java and then check the return code. Also, you could run the other application in its own controller thread from your first application.

Running one application via another batch file seems like an awkward design...

Sign up to request clarification or add additional context in comments.

1 Comment

Beware return code of launched java apps under MS Windows is typically not going to give you an error indication.
1

Why using a batch file? For all practical purposes, this is counter productive while using a platform independent language! Java can do well better than what batch files can do, and also will protect your application by not exposing how you launch other processes while not being dependent of a batch file process successful state...

Anyway, take a look here at how to start external processes and monitoring outputs using ProcessBuilder.

Also, you can check out the API.

1 Comment

Not everyone picks Java for its platform independence. Heck, you can argue the same with people who write platform-specific C. That part of your answer is pretty much unhelpful.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.