CommandLine#parse と addArgument の両方を試しました:
DefaultExecutor executor = new DefaultExecutor();
executor.execute(CommandLine.parse("ls /Users/jizhang/*.py"));
CommandLine cmd = new CommandLine("ls");
cmd.addArgument("/Users/jizhang/*.py", false);
executor.execute(cmd);
例外は次のとおりです。
ls: /Users/jizhang/*.py: No such file or directory
Exception in thread "main" org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
しかし、実際にはそのフォルダーにファイルがあります。
prey:~ jizhang$ ls /Users/jizhang/*.py
/Users/jizhang/ana.py /Users/jizhang/send_image.py
/Users/jizhang/push.py /Users/jizhang/t.py
引用についてだと思いますが、修正方法がわかりません。