Reputation: 219
I have OpenOffice installed on both a Windows and a Linux machine. I want to write a simple Java application that will connect to OpenOffice remotely and do some file conversion. I want to run OpenOffice as a service on both Windows and Linux on some random port. After the file conversion is done, I want to stop the service.
Upvotes: 1
Views: 1575
Reputation: 2110
You need to start first :
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
then use some library to connect and use the service like jodconverter
To call an executable from java :
Process process = new ProcessBuilder("C:\\PathToExe\\MyExe.exe","param1","param2").start();
You gave him your path to openoffice exe, then each parameter (-headless
...)
Upvotes: 1