Hi Arun,

Here's an example of how to do it (Use Runtime class).  This is an example
I created under Sun Solaris environment.  Look at the Runtime class doc
under java.lang.  There are several constructors under the exec() method.
 You can also pass environment specific stuff, like PATH to locate the
program you are trying to execute.  It throws and IOException so you
need to catch that.

Another option that you have is to use Java Native Interface (JNI) methodology.

Also realize that your application may not be 100% Pure Java, when you
do an OS specific stuff like this.
// ===============================================================
// Test.java
import java.io.*;

public class Test {
    public static void main(String[] args) {
        try {
            Runtime.getRuntime().exec("xterm");
        } catch (IOException e) {
            System.out.println("Error: " + e);
        }

    } // end main
} // end class Test
// ===============================================================

--
Antonio W. Lagnada
[EMAIL PROTECTED] - email

This email address is specifically
for JSP-Interest email list


---- arun prakash <[EMAIL PROTECTED]> wrote:
> HI.,
>          I need to invoke a shell script from my JSP
> page...how do i go about it. Any suggestions is most
> welcomed.
>
> regards
> arun.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

___________________________________________________________________
To get your own FREE ZDNet Onebox - FREE voicemail, email, and fax,
all in one place - sign up today at http://www.zdnetonebox.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to