Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I call an external program in the java?

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I call an external program in the java?

Ex: to call notepad.exe in the java
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you are talking about accessing the exec() method of the java.lang.Runtime class. Below is a bit of example code that should do what you are describing. Please note that I am working on a Linux system, and used "rxvt" as my system call. You should be able to substitute "notepad.exe" for this without much trouble.
Please check the API documentation for more details.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic