Ok !!!

It works with "Notepad.exe"
Can you explain me why if when I try to execute "javac Application.java"
(Application.java is a valid java application in current directory) isn't
work. That I need.
Help....
Initially a used a native interface and I used System() from C and it works.

Thx in advance. Tudor


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Thierry Boutevin
Sent: Thursday, February 14, 2002 10:34 AM
To: [EMAIL PROTECTED]
Subject: Re: OT Run a system command from java.


Yes here is an exemple

RT = Runtime.getRuntime()  ;

     try {
           p = RT.exec("notepad.exe")      ;
          } catch(IOException e) {
          System.out.println("IOException: " + e.getMessage());
          }

Thierry


|--------+------------------------------->
|        |          "Dahnke, Eric"       |
|        |          <[EMAIL PROTECTED]|
|        |          OM>                  |
|        |          Sent by: "A mailing  |
|        |          list for discussion  |
|        |          about Sun            |
|        |          Microsystem's Java   |
|        |          Servlet API          |
|        |          Technology."         |
|        |          <SERVLET-INTEREST@JAV|
|        |          A.SUN.COM>           |
|        |                               |
|        |                               |
|        |          14/02/2002 00:57     |
|        |          Please respond to "A |
|        |          mailing list for     |
|        |          discussion about Sun |
|        |          Microsystem's Java   |
|        |          Servlet API          |
|        |          Technology."         |
|        |                               |
|--------+------------------------------->

>---------------------------------------------------------------------------
---------------------------------|
  |
|
  |       To:     [EMAIL PROTECTED]
|
  |       cc:
|
  |       Subject:     OT Run a system command from java.
|

>---------------------------------------------------------------------------
---------------------------------|



Perl and PHP have exec() or system() to invoke OS level executeables.
Does
Java have anything similar?


Regards, Eric

___________________________________________________________________________

To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources:
http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to