Preguntas etiquetadas con runtime.exec

11
¿Cómo ejecuto un archivo por lotes desde mi aplicación Java?
En mi aplicación Java, quiero ejecutar un archivo por lotes que llame a " scons -Q implicit-deps-changed build\file_load_type export\file_load_type" Parece que ni siquiera puedo ejecutar mi archivo por lotes. No tengo ideas. Esto es lo que tengo en Java: Runtime. getRuntime(). exec("build.bat", null, new File(".")); Anteriormente, tenía un archivo Python …

4
¿Cómo hacer que las tuberías funcionen con Runtime.exec ()?
Considere el siguiente código: String commandf = "ls /etc | grep release"; try { // Execute the command and wait for it to complete Process child = Runtime.getRuntime().exec(commandf); child.waitFor(); // Print the first 16 bytes of its output InputStream i = child.getInputStream(); byte[] b = new byte[16]; i.read(b, 0, b.length); …
104 java  exec  runtime.exec 

4
Diferencia entre ProcessBuilder y Runtime.exec ()
Estoy tratando de ejecutar un comando externo desde el código Java, pero he notado una diferencia entre Runtime.getRuntime().exec(...)y new ProcessBuilder(...).start(). Al usar Runtime: Process p = Runtime.getRuntime().exec(installation_path + uninstall_path + uninstall_command + uninstall_arguments); p.waitFor(); exitValue es 0 y el comando finaliza correctamente. Sin embargo, con ProcessBuilder: Process p = (new …

Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.