Article View: es.comp.lenguajes.java
Article #26890Re: Llamada a un ejecutable desde Java
From: Fifeton
Date: Fri, 20 Nov 1998 00:00
Date: Fri, 20 Nov 1998 00:00
25 lines
1316 bytes
1316 bytes
Aupa Itxaso, Toni & compa��a:
A ver si os vale esto...
Itxaso Barrio wrote:
>
> Hola, me gustar�a saber c�mo puedo llamar a un programa ejecutable desde
> Java. Me imagino que habr� que utilizar alguna funci�n del API 32, no??
-------------------------------------------------------------------
> Jian,
> Java creates a single instance of Runtime for each application. In
> order for the program to access it you have to use the
> Runtime.getRuntime() method. The code that follows works on Solaris,
> and substituting the msg string with MS-DOS commands works on WinNT
>
> String msg = "rm " + <file names>
> //
> Process ps = Runtime.getRuntime().exec(msg);
> // for debug
> System.out.println("rm returned " + ps.exitValue());
> ps.destroy();
Agur! Fifeton
Technical Details
Message-ID:
<36557B4E.4B374C04@iname.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<733jvk$3bf$1@diana.bcn.ibernet.es>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 1116f3,a142c6fbdb9e476c X-Google-Attributes: gid1116f3,public From: Fifeton <fifeton@iname.com> Subject: Re: Llamada a un ejecutable desde Java Date: 1998/11/20 Message-ID: <36557B4E.4B374C04@iname.com> X-Deja-AN: 413875712 Content-Transfer-Encoding: 8bit References: <733jvk$3bf$1@diana.bcn.ibernet.es> Content-Type: text/plain; charset=iso-8859-1 Organization: Bilbomatica S.A Mime-Version: 1.0 Newsgroups: es.comp.lenguajes.java