次のコマンドは、ターミナルから実行すると完全に機能します。
rm -f /home/folkman/Desktop/DimacsProba/*
ただし、Javaで実行したい。私は Netbeans を使用していますが、古いバージョンの Ubuntu を使用したときは機能しました。
Runtime.getRuntime().exec("rm -f /home/folkman/Desktop/DimacsProba/*");
さて、Ubuntu 13.04 で。次のどれも機能していません。
//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();
Ubuntuのせいではないのかもしれませんが、よくわかりません。助けてください!ありがとうございました!