|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Feb 2003
Città: GE
Messaggi: 397
|
[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?
|
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Dec 2001
Messaggi: 1385
|
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)
__________________
lui è il mio amore: "tesò domani ti regalo un guinzaglio lungo 100 km"
|
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Dec 2001
Messaggi: 1385
|
p.s. cmq exec() in windows funziona solo con programmi win32 ma non con comandi DOS
__________________
lui è il mio amore: "tesò domani ti regalo un guinzaglio lungo 100 km"
|
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Feb 2003
Città: GE
Messaggi: 397
|
Me ne sono tragicamente accorto!!!!!!
|
|
|
|
|
|
#5 |
|
Senior Member
Iscritto dal: Dec 2001
Messaggi: 1385
|
allora volevi far eseguire un pgm dos??
__________________
lui è il mio amore: "tesò domani ti regalo un guinzaglio lungo 100 km"
|
|
|
|
|
|
#6 |
|
Senior Member
Iscritto dal: Feb 2003
Città: GE
Messaggi: 397
|
Per essere precisi un programma linux ricompilato per dos...
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 15:34.



















