This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You can't catch an exception in an external process. Not with pure Java anyway. Maybe an individual O.S. may provide APIs for running programs with more control over error handling, but you'd have to access that with JNI.
If the program you are running is in fact a Java application, then you could gain more control by running it within the same JVM, instead of as an external process. Instead of invoking its executable, make its classes available to some or other ClassLoader, and invoke its main() method. You can try...catch around that invocation and hence catch any Java exception.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Joined: Jun 13, 2006
I suspected as much.
Thank you Peter!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: catching an exception thrown by a commandline app.