External program execution in Java under windowsジャワされて外部プログラムが実行されるWindowsの
Question?質問ですか? Amitava Ghosh wrote at caljug:ゴーシュamitavaで書いたcaljug :
Dear all,親愛なるすべて、
I am trying to call an executable(written in C++) inside a java code through a私はしようとして請求する実行可能ファイル( C + +で書か)の中にJavaコードを介して
batch file(where the parameters for the C++ executable are stored).バッチファイル(ここでするためのパラメータをC + +の実行可能ファイルが格納さ) 。
When I am usingときに私は使用して
Process p = Runtime.getRunTime().exec(”cppexe.bat”)プロセスp = runtime.getruntime ( ) 。実行( " cppexe.bat " )
it is working fine but when I am using start to run the batch process in a new window as inこれは作業罰金しかし、私は使用して起動時にバッチ処理を実行すると、新しいウィンドウのように
Process p = Runtime.getRuntime().exec(”start cppexe.bat”)プロセスp = runtime.getruntime ( ) 。実行( "スタート]ボタンをcppexe.bat " )
I am getting an IOException Cannot create process etc etc私は就学許可証にIOExceptionプロセス等等を作成することはできません
Answer: start is a command of cmd.exe (under Windows NT/2000 etc.).答: スタート]ボタンは、コマンドのcmd.exeで(下のWindows NT/2000の等)です。 So you should run it instead:これを実行する必要がそれの代わりに:
Process p = Runtime.getRuntime().exec(”cmd /c start cppexe.bat”);プロセスp = runtime.getruntime ( ) 。実行(に" cmd /スタート]ボタンをcppexe.bat " ) ;
Filed under提出されて Java Software Javaソフトウェア | |
| |
RSS 2.0 RSS 2.0を | |
Email this Article電子メールこの記事
You may also like to readを読むようにすることも可能 |





February 29th, 2004 at 10:04 pm 2004年2月29日10:04 pmの
Runtime.exec() is not a command line! runtime.exec ( )は、コマンドラインではない!
You cannot do starts, redirections, etc.を行うことができませんが起動すると、リダイレクト、等
Check this article:空この記事:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
December 3rd, 2004 at 6:16 pm 2004年12月3日は6:16 pmの
You can invoke start if you prefix it with cmd.exe, essentially then cmd.exe is the command and the rest are parameters.接頭辞スタート]ボタンを起動することができます。場合にそれをcmd.exeで、 cmd.exeでは、本質的にコマンドを入力し、残りはパラメータとします。 However why would you need to do start?しかしこれを行うに開始する必要がなぜですか?
> To run the Windows command interpreter, execute either command.com or cmd.exe, depending on the Windows operating system you use. > Windowsのコマンドを実行するに通訳、 command.comやcmd.exeで実行するのいずれかに応じて、 Windowsオペレーティングシステムを使用する。 Listing 4.5 runs a copy of the Windows command interpreter and then executes the user-supplied command (eg, dir).リスト4.5は、 Windowsのコピーを実行するコマンドインタプリタと入力し、コマンドを実行し、ユーザーが提供する(例えば、ディレクトリです) 。
Yes, you can do re-directions using the same trick mentioned above.はい、することができます。行うと同じトリックを再使用して、上述の方向です。
Actually the url you supplied gives the above solutions too.実際にはURLを供給により、上記のソリューションが判明しました。
July 29th, 2007 at 11:00 am 2007年7月29日午前11時
hey thank u very much非常に感謝ねえu
i was searching how to run cmd.exe in a java program私は検索を実行する方法をJavaプログラムにcmd.exe
u helped me a lotたくさん助けてくれたu
once again thank u very much再び非常に感謝u