Forums Register Login

waitFor() does not wait for LibreOffice calc.

+Pie Number of slices to send: Send
Hi,

I'm trying to call LibreOffice calc from Java and wait until the Calc finish, I mean, when the user saves the spreadsheet and closes the program.
The problem is that waitFor() continues and doesn't wait.
This is the code:




I realized that, when LibreOffice is in memory to run faster, then waitFor does not work. But if LibreOffice is run directly then waitFor work.

I appreciate any help in advance.

Javiercl.
+Pie Number of slices to send: Send
 

Javier Corral wrote:
I realized that, when LibreOffice is in memory to run faster, then waitFor does not work. But if LibreOffice is run directly then waitFor work.



The waitFor() method does wait until the process exits. I don't know what you mean about it being "in memory to run faster", but if that means that the LibreOffice command kicks off a background job and then exits, then what you're seeing is totally expected--the LibreOffice command has completed, even if not all of the work it's initiating is done.
+Pie Number of slices to send: Send
Thanks for your reply.

I think that after starting LibreOffice, this gives control to a background process and then LibreOffice finishes immediately. I have asked a question to LibreOffice forum. If they give me some answer I'll put it here.

Regards.
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 883 times.
Similar Threads
exec command cd then command java
Class Path
Running UNIX command from Java
Executing dos commands
Differnece between setVisible() and show() methods
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:23:35.