Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

launching .exe programs from java  RSS feed

 
Maysam Sorkhabi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'd like to know how I can run native windows applications such as netstat.exe from java code. In particular I am interested in having a java GUI display the results of a command such as netstat -a. Does this invlove using the JNI interface? Your comments are much appreciated.
 
Roshini Sridharan
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
U can run exe's from Java program with the following snippet of code

Runtime rt = Runtime.getRuntime();
Process run = rt.exec("exefilename arguments");
run.waitFor();

Regards
Roshini
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!