Bonjour,
j'essaye de lancer l'execution d'une appli depuis mon code java, mais ca
plante, meme un petit "dir" tout simple, quelqu'un aurait-il la solution ?
Mon code:
Runtime runtime = Runtime.getRuntime();
String exec[] = new String[1];
exec[0] = "dir";
String env[] = new String[0];
File f = new File(".\\annuaire");
try {
runtime.exec(exec);
}
catch(Exception e) {
e.printStackTrace();
}
l'erreur:
java.io.IOException: CreateProcess: dir error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:63)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:491)
at java.lang.Runtime.exec(Runtime.java:457)