`
wilsonxu
  • 浏览: 5759 次
  • 性别: Icon_minigender_1
  • 来自: 广州
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

block when call external program in java

阅读更多
oops~ it blocks when i call external program in java >_<

why?

go to the jdk Runtime doc:

引用
the created subprocess does not have its own terminal or console.


引用
Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.


here it is!!! the external need somewhere to output something, or it will block.

so, two ways to fix it.

1. grab the output/error stream in your program.

2. call external program through cmd, using cmd /c start ...


分享到:
评论

相关推荐

    JSP Simple Examples

    In try block we write those code which can throw exception while code execution and when the exception is thrown it is caught inside the catch block. Multiple try catch We can have more than one try/...

    Java邮件开发Fundamentals of the JavaMail API

    your program to use IMAP instead of POP and expect everything in IMAP to be supported. Assuming your mail server supports IMAP, your JavaMail-based program can take Fundamentals of the JavaMail API...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: Close query twice when program closing with modified documents. - ADD Added editing form for TBackgroundOptionsProp property in the FlexEdit/FlexEditSE projects. Version 1.6 ----------- - ...

    EurekaLog_7.5.0.0_Enterprise

    Later is supported when map2dbg.exe tool is placed in \Bin folder of EurekaLog installation (separate download is required) 5)....Added: Exception2HRESULT in EAppDLL to simplify developing DLLs with ...

    C Programming

    - **Getting Values into the Program**: Discussion on how to read values from external sources, such as keyboard input, and store them in variables. #### Writing a Program This section provides ...

    Bochs - The cross platform IA-32 (x86) emulator

    - When x86-64 support is compiled in, you could enable/disable long mode 1G pages support without recompile using new CPUID option in .bochsrc. Configure options: --enable-mmx, --enable-sse, --...

    微软内部资料-SQL性能优化2

    A stack is an area of memory in which program procedure or function call addresses and parameters are temporarily stored. In Process To run in the same address space. In-process servers are loaded ...

    微软内部资料-SQL性能优化3

    The rsc_bin column of master..syslockinfo contains the resource block in hexadecimal format. For an example of how to decode value from this column using the information above, let us assume we have ...

    ICS delphixe10源码版

    all developers having contributed (When no name is given, the change is by F. Piette). I can't list all contributors here but I want to specially thanks two specially active contributors: - Arno ...

    INTRODUCTION TO PYTHON SCRIPTING FOR MAYA ARTISTS.

    - **Built-In and Third-Party Modules:** Python includes many built-in modules, such as math and datetime, and supports third-party modules through external libraries like NumPy and Pandas. **Files ...

    occam一维反演

    C THE COMMON BLOCK /DATA/. SEE OCCAM HEADER. C INPUTM(FILENAME), TAKES THE NAMED FILE AND READS IN ANY FIXED ATTRIBUTES C OF THE MODEL, SUCH AS LAYER THICKNESSES, FINITE ELEMENT MESH, ETC. ...

    C++经典书籍高频词汇_不怕看不懂英文著作

    `define`, `macro`, `will`, `example`, `chapter`, `has`, `sequence`, `than`, `call`, `used`, `set`, `result`, `number`, `when`, `new`, `conversion`, `exception`, `library`, `its`, `other`, `input`, `...

Global site tag (gtag.js) - Google Analytics