How do I get OpenOffice to exit?
Posted: Wed Mar 23, 2016 4:32 pm
I'm running a Java UNO API app that launches OpenOffice Writer in headless mode, opens a couple of Writer docs, does some stuff to them, and then closes both docs.
Once OO has done what I want, it sometimes exits and sometimes it doesn't. I don't know why, but I want it to exit every time. How do I do this?
My API app is the only client to OO, so there's no reason to keep OO running.
Here is how my app finishes:
Advice very appreciated.
Thanks,
Tim.
Once OO has done what I want, it sometimes exits and sometimes it doesn't. I don't know why, but I want it to exit every time. How do I do this?
My API app is the only client to OO, so there's no reason to keep OO running.
Here is how my app finishes:
Code: Select all
{
//...
try {
//...
//Closing styled doc and exiting...
if (xCloseableStyledDoc != null) {
xCloseableStyledDoc.close(false);
} else {
xDoc.dispose();
} catch (java.lang.Exception e) {
e.printStackTrace();
} finally {
System.exit(0);
}
}
Thanks,
Tim.