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

calling an exe file stored in Tomcat/webapps from JSP  RSS feed

 
Haricherrytec krishnan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir,


I want to call eclipse.exe file which is stored in Tomcat/webapps/hari/eclipse.exe from jsp,my code is

<%

Runtime r = Runtime.getRuntime();
Process p = null;
try
{
p = r.exec("d:/tomcat/webapps/hari/eclipse.exe");
}
catch(Exception e)
{
e.printStackTrace();
}

%>

it is not calling that exe file and no error msg too.

I am able to call this exe file when it is in my localdrive instead of in Tomcat/webapps with this same code with the change of path.
What is the error i committed?


Thankyou
Harikrishnan J.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Executing a program in this manner should be independent of where the exe file is located. If the absolute file system path you provided is correct, it makes no difference if that folder is part of a web application or not.

What may be happening is that the program is not appearing where you expect. Are you expecting the program to appear on the client or the server?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. It will execute and appear on the server, not the client.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!