Ich habe NFS für Windows 2008 installiert, aber wenn ich versuche, auf C: /Windows/System32/mount.exe oder umount.exe zuzugreifen und es in Java auszuführen Ich bekomme eine IO Exception, dass die Datei nicht gefunden werden kann.Runtime.getRuntime(). Exec() Problem mit Windows NFS in Java
Runtime.getRuntime().exec("C:/Windows/System32/mount.exe <location> J:");
dies auch nicht funktioniert, wenn Sie es dachten vielleicht:
Runtime.getRuntime().exec("cmd.exe /C call C:/Windows/System32/mount.exe <location> J:");
Die Datei wird nicht einmal als bestehende durch Java registrieren
if(new File("C:/Windows/System32/mount.exe").exists())
System.exit(0);
else
System.exit(-1);
Dieser Code wird immer Ausgang -1
Ich habe immer und immer wieder verifiziert, dass die Datei tatsächlich existiert und mein Befehl funktioniert. Was ist los? Wie kann ich ein NFS-Laufwerk über Java für Windows mounten?
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
Ich habe versucht, zu CMD als Administrator
Veröffentlichen Sie bitte die Stapelverfolgung. –
Das klingt nach einem Problem mit der Bit-Zahl (d. H., Es wird eine 32-Bit-Version von Java mit einer 64-Bit-Version von SUA installiert). 'C: \ Windows \ System32' wird für 32-Bit-Anwendungen nach' C: \ Windows \ SYSWOW64' umgeleitet. Siehe [diese Frage] (http://stackoverflow.com/questions/1855042/system32-folder-on-a-64-bit-system) – ig0774
@ user1314180: Fertig. So etwas ging mir durch den Kopf, als ich mich vor nicht allzu langer Zeit mit einem ähnlichen Thema befasste. – ig0774