Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

run exe from servlet

 
kodali s
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this code in my java testclass.
Runtime rt = Runtime.getRuntime();
rt.exec("C:/winnt/system32/notepad.exe");
If I run this class file in Command prompt it is opening notepad.exe but the problem is if i copy same code into my servlet it is not openning notepad.exe. Even if i take an instance of my class in the servlet still it is not calling notpad.exe and it is not giving any error.
Can anybody help me.
Thanks in advance.
 
Sandeep Jain
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,
I tried ur code and it works fine on my machine. As my times I click on the refresh window, those many notepad applications are opening .
Anyway , Just wanted to tell u that In servlet making use of Runtime classes will open the apl;ication or execute the application on the server and not the client side .

------------------
Try and Try Till u succeed
Sandeep Jain
 
kodali s
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
If I want to run an application in client machine what should I do. I am using java, jsp, and servlets.
Thanks,
kodali

[This message has been edited by kodali s (edited May 31, 2001).]
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"kodali s",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic