Problemas con Runtime.getRuntime.exec()
Publicado por iGNASI85 (23 intervenciones) el 26/09/2006 03:11:17
Tengo una aplicación JAVA (GUI), que entre otras cosas, necesito que cuando presiono un JButton, este "llame" a un script. No hay problema salvo que dicho script, tiene que estar obligatoriamente en la ruta "." (línea de código 1), el mismo directorio de donde lanzo el GUI primitivo, ya que si intento ejecutar directamente de la carpeta natura del script, éste, no se ejecuta(línea de código 2).
He probado cambiar el current work dictory al de la carpeta contenedora del script, usando la línea de código 3 y 4(incluso con la línea 5 de código), pero tampoco funciona.
LÍNEA 1 --> Process p = Runtime.getRuntime().exec("./runap.sh out");
LÍNEA 2 --> Process p = Runtime.getRuntime().exec("./fibonacci/runap.sh out");
LÍNEA 3 --> System.setProperty("user.dir", "/home/ignasi/tfc/compp2p/fibonacci");
LÍNEA 4 --> Process p = Runtime.getRuntime().exec("./runap.sh out");
LÍNEA 5 --> Process p = Runtime.getRuntime().exec("/home/ignasi/tfc/compp2p/runap.sh out");
Muchas gracias, este tema me tiene loco !!
He probado cambiar el current work dictory al de la carpeta contenedora del script, usando la línea de código 3 y 4(incluso con la línea 5 de código), pero tampoco funciona.
LÍNEA 1 --> Process p = Runtime.getRuntime().exec("./runap.sh out");
LÍNEA 2 --> Process p = Runtime.getRuntime().exec("./fibonacci/runap.sh out");
LÍNEA 3 --> System.setProperty("user.dir", "/home/ignasi/tfc/compp2p/fibonacci");
LÍNEA 4 --> Process p = Runtime.getRuntime().exec("./runap.sh out");
LÍNEA 5 --> Process p = Runtime.getRuntime().exec("/home/ignasi/tfc/compp2p/runap.sh out");
Muchas gracias, este tema me tiene loco !!
Valora esta pregunta


0