peterv6i General User


Joined: 13 Jun 2005 Posts: 36
|
Posted: Fri Nov 18, 2011 12:01 am Post subject: Java - swriter.exe (wait for the process to be ended) how? |
|
|
Hello,
I have a situation in Oracle Forms when I must invoke Open Office with some odt or sxw file from pluggable java component (oracle forms).
The problem is if the customer has openoffice "quick start" enabled in taks bar then the p.waitFor() is ignored... (it wan't wait for the process to be ended).
I must wait for the process to be ended because after the open office is closed i must upload changed sxw ord odt to my databse (dynamic reports with open office)..
What is the way to resolve this problem? (I must use jdk1.3! (Jinitiator engine))
The code to launch open office process..
| Code: | public OpenOfficeProces() {
System.out.println("Start");
try {
String line;
Runtime r = Runtime.getRuntime();
Process p = r.exec("C:/Program Files (x86)/OpenOffice.org 3/program/swriter.exe'");
int x = p.waitFor();
System.out.println("smo leti...Done." + x);
} catch (Exception err) {
err.printStackTrace();
}
} |
|
|