import java.io.*;
import java.lang.*;
public class teste{
public static void main(String args[]){
String dataset = "breast-w";
String ext = ".arff";
String nome_dataset = dataset + ext;
String foldTest = dataset + "-test" + ext;
String foldTrain = nome_dataset;
String resultados = dataset + "_result.txt";
String cmdTrain = "java -cp c:\\weka\\weka.jar weka.classifiers.trees.J48 -v -t " + foldTrain + " -T " + foldTest;
try {
// Execute command
String command = "dir";
System.out.println("1");
Process child = Runtime.getRuntime().exec(command);
System.out.println("2");
// Get input stream to read from it
BufferedReader in = new BufferedReader(child.getInputStream());
try{
String linha = "";
while((linha = in.readLine()) != null){
System.out.println(linha);
}
}
catch(Exception e){
e.printStackTrace();
}
System.out.println("58");
} catch (IOException e) {
}
}
}
Estou utilizando o seguinte metodo para executar o comando
System.out.println("1");
Process child = Runtime.getRuntime().exec(command);
System.out.println("2");
eu coloquei estes 2 println pra ver se estava dando certo, porem nao imprimiu o segundo, tem alguma maneira de eu executar um comando q de certo?