 
View Full Version : [java] e Runtime.exec() aiuto....
Ho provato a lanciare un eseguibile che necessitava di parametri, ma ho scoperto che Runtime.exec(cmd) esegue una tokenizzazzione (brrr che termine brutto...) di cmd per ciņ addio parametri, secondo voi come posso fare a passare i parametri al mio programma? :mc: :muro:
monkey72
20-07-2003, 00:18
da quest'estratto delle Api Java2:
Process exec(String command) 
          Executes the specified string command in a separate process. 
Process exec(String[] cmdarray) 
          Executes the specified command and arguments in a separate process. 
Process exec(String[] cmdarray, String[] envp) 
          Executes the specified command and arguments in a separate process with the specified environment. 
Process exec(String[] cmdarray, String[] envp, File dir) 
          Executes the specified command and arguments in a separate process with the specified environment and working directory. 
Process exec(String cmd, String[] envp) 
          Executes the specified string command in a separate process with the specified environment. 
Process exec(String command, String[] envp, File dir) 
          Executes the specified string command in a separate 
process with the specified environment and working directory 
sembrerebbe che tu debba inserire il comando e i parametri in un vettore (secondo metodo)
monkey72
20-07-2003, 00:21
p.s. cmq exec() in windows funziona solo con programmi win32 ma non con comandi DOS
Me ne sono tragicamente accorto!!!!!!
monkey72
21-07-2003, 11:44
allora volevi far eseguire un pgm dos?? :) :D
Per essere precisi un programma linux ricompilato per dos...
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.