What you do with the output of the command executed is entirely up to you and the application you’re creating. Then you use the getInputStream() and getErrorStream() methods of the Process object to read the normal output of the command, and the error output of the command. Invoking the exec method returns a Process object for managing the subprocess. Basically, you use the exec method of the Runtime class to run the command as a separate process. It involves the use of two Java classes, the Runtime class and the Process class. Executing a system command is relatively simple – once you’ve seen it done the first time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |