Je veux attendre jusqu'à ce que ma commande batch termine son exécution et crée un fichier csv comme hors put.the le code est comme ci-dessous pour excecuting fichier batchcomment attendre pour la commande de lot pour compléter son excecution en java
String command = "cmd /c start " + batFile;
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(command);
Ensuite, je veux utiliser le fichier CSV (app.csv) pour en lire le contenu. Mais quand je cours le programme je reçois comme.
java.io.FileNotFoundException: C:\appanalysis\app.csv (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at java.io.FileInputStream.<init>(FileInputStream.java:79)
at java.io.FileReader.<init>(FileReader.java:41)
Comment résoudre ce
Check http://stackoverflow.com/questions/15199119/runtime-exec-waitfor-doesnt-wait-until-process-is-done – JRR