Here's the section of code that fails at runtime with a fatal exception.
// Check-in source file into PVCS.
String commandString2 = new String("put -u -t\"first
revison\" " + dirFileList[j]);
System.out.println ("PVCS command = " + commandString2
);
Runtime myRunTime2 = Runtime.getRuntime();
Process myProcess2 = null;
try
{
myProcess2 = myRunTime2.exec( commandString2 );
}
catch (IOException iox)
{
iox.printStackTrace();
}
// Wait for this process to complete.
try
{
myProcess2.waitFor();
}
catch (InterruptedException ie)
{
ie.printStackTrace();
}
At runtime I get :-
PVCS command = put -u -t"first revison" BigInteger.java
java.io.IOException: CreateProcess: put -u -t"first revison"
BigInteger.java error=2
at java.lang.Win32Process.<init>(Win32Process.java:59)
at java.lang.Runtime.exec(Runtime.java:175)
at java.lang.Runtime.exec(Runtime.java:137)
at CheckinTree.DescendTree(CheckinTree.java:162) <= this
line is where I try to invoke Runtime.exec(String).
Anyone know why I can't (as it appears) create a process ?
cheers,
Deepak Gupta
try this
String executer(String cmd)
{
String erreurs="";
String erreur;
try
{
Process p =Runtime.getRuntime().exec(cmd);
DataInputStream dis=new DataInputStream(p.getErrorStream());
while ((erreur=dis.readLine()) != null) erreurs+=erreur+'\n';
p.waitFor() ;
}
catch(Exception ex) {erreurs="Impossible de lancer (le chemin de
l'application est sans doute faux)";}
return(erreurs);
}
--
Colar Thibaut
USTL France
co...@lifl.fr