The following command is working perfectly when I execute it from the terminal:
rm -f /home/folkman/Desktop/DimacsProba/*
However, I want to execute it with Java. I am using Netbeans and when I used an older version of Ubuntu, it worked:
Runtime.getRuntime().exec("rm -f /home/folkman/Desktop/DimacsProba/*");
Now, with Ubuntu 13.04. nothing of the following is working:
//1
Runtime.getRuntime().exec("rm -f /home/folkman/Desktop/DimacsProba/*");
//2
Runtime.getRuntime().exec(new String[]{"rm" , "-f", "/home/folkman/Desktop/DimacsProba/*"});
// 3
ProcessBuilder pb= new ProcessBuilder("rm","/home/folkman/Desktop/DimacsProba/*");
Process p=pb.start();
Maybe it is not because of the Ubuntu, but I really don't know. Please help! Thank you!