How do I get OpenOffice to exit?

The Application Programming Interface and the OASIS Open Document Format

How do I get OpenOffice to exit?

Postby Tim Grantham » 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:
Code: Select all   Expand viewCollapse view
{
            //...
           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);
             }
}


Advice very appreciated.

Thanks,
Tim.
OpenOffice 4.1
Windows 7 Professional
Tim Grantham
 
Posts: 26
Joined: Thu Jan 06, 2011 12:03 am

Re: How do I get OpenOffice to exit?

Postby RoryOF » Wed Mar 23, 2016 5:38 pm

Try inserting a delay before the exit command. If this works you may have to fine tune the delay period to get consistent results.
Apache OpenOffice 4.1.4 on Xubuntu 16.04.03 (mostly 64 bit version) and infrequently on Win2K/XP
14 October 2016 was Pooh's 90th birthday
User avatar
RoryOF
Moderator
 
Posts: 25509
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How do I get OpenOffice to exit?

Postby Villeroy » Wed Mar 23, 2016 6:05 pm

Disable the "quick starter" and see if it is related to your problem.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24656
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How do I get OpenOffice to exit?

Postby Tim Grantham » Wed Mar 23, 2016 6:49 pm

Thanks, I'll try it.
OpenOffice 4.1
Windows 7 Professional
Tim Grantham
 
Posts: 26
Joined: Thu Jan 06, 2011 12:03 am


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 3 guests