Windows 2008 に NFS をインストールしましたが、C:/Windows/System32/mount.exe または umount.exe にアクセスして Java で実行しようとすると、ファイルが見つからないという IO 例外が発生します。
Runtime.getRuntime().exec("C:/Windows/System32/mount.exe <location> J:");
これは、次の可能性があると考えていた場合にも機能しません。
Runtime.getRuntime().exec("cmd.exe /C call C:/Windows/System32/mount.exe <location> J:");
ファイルはJavaを介して存在するものとして登録さえしません
if(new File("C:/Windows/System32/mount.exe").exists())
System.exit(0);
else
System.exit(-1);
このコードは常に終了します -1
ファイルが実際に存在し、コマンドが機能することを何度も確認しました。何が起こっている?Java for Windows を使用して NFS ドライブをマウントするにはどうすればよいですか?
java.io.IOException: Cannot run program "C:/Windows/System32/mount.exe": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at Data.SystemExecutor.exec(SystemExecutor.java:46)
at Data.SystemExecutor.exec(SystemExecutor.java:18)
at Mount.Mount.setMount(Mount.java:40)
at Mount.Mount.<init>(Mount.java:30)
at Main.Main.main(Main.java:94)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 6 more
私もCMDを管理者として実行してみました