tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Hunter <jhun...@collab.net>
Subject Re: Can't execute Runtime.getRuntime().exec()
Date Wed, 21 Jun 2000 16:37:01 GMT
> "DonS, Choi" wrote:
> 
> Hi,
> 
> --- test1.jsp --
> <%
>         Runtime.getRuntime().exec("/usr/bin/ls > /tmp/test" );
> %>
> 
> test1.jsp did not execute.

Problem is ">" is a shell command and Java doesn't exec within a shell. 
You need to run a shell, and pass the arguments to the shell.  It's
outlined in Chapter 13 of my book.  http://www.servlets.com/book. 
Examples are online.

-jh-



Mime
View raw message