code_junkie

Problem with starting OpenOffice service (soffice) from Java (command working in commandline, but not from Java)

Nov 13th, 2011
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. soffice -headless "-accept=socket,host=localhost,port=8100;urp;"
  2.  
  3. String[] commands = new String[] {"soffice","-headless",""-accept=socket,host=localhost,port=8100;urp;""};
  4. Process process = Runtime.getRuntime().exec(commands)
  5. int code = process.waitFor();
  6. if(code == 0)
  7. System.out.println("Commands executed successfully");
  8.  
  9. String[] commands = new String[] {"soffice","-headless","-accept=socket,host=localhost,port=8100;urp;"};
  10. Process process = Runtime.getRuntime().exec(commands);
  11. int code = process.waitFor();
  12. if(code == 0)
  13. System.out.println("Commands executed successfully");
  14.  
  15. String[] commands = new String[] {"soffice","-headless","-accept=socket,host=localhost,port=8100;urp;"};
  16. Process process = Runtime.getRuntime().exec(commands);
  17. int code = process.waitFor();
  18. if(code == 0)
  19. System.out.println("Commands executed successfully");
  20.  
  21. String[] commands = new String[] {"soffice","-headless","-accept=socket,host=localhost,port=8100;urp;"};
  22. Process process = Runtime.getRuntime().exec(commands);
  23. int code = process.waitFor();
  24. if(code == 0)
  25. System.out.println("Commands executed successfully");
Add Comment
Please, Sign In to add comment