Hi all,
How can i executing a Operating command in java ? as below ?
public class Exec {
public static void main(String[] args) {
System.out.println("Begin");
Runtime r= java.lang.Runtime.getRuntime();
System.out.println("r.totalMemory()="+r.totalMemory());
System.out.println("r.freeMemory()="+r.freeMemory());
try {
r.exec("mkdir c:\\kkk");
}
catch (Exception ex) {
ex.printStackTrace();
}
}
}
Why I get such Error message ?
Begin
r.totalMemory()=2031616
r.freeMemory()=1842840
java.io.IOException: CreateProcess: mkdir c:\kkk error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:551)
at java.lang.Runtime.exec(Runtime.java:418)
at java.lang.Runtime.exec(Runtime.java:361)
at java.lang.Runtime.exec(Runtime.java:325)
at Exec.main(Exec.java:9)
You help will be appreciated.
Best Regards.
ZhaoBin
----- Original Message -----
From: "Chris Pratt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 28, 2001 4:42 AM
Subject: Re: Executing a unix commmand in jsp
> Take a look at the java.lang.Runtime.exec() methods.
> (*Chris*)
>
> ----- Original Message -----
> From: "Mihir Sahu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 27, 2001 1:24 PM
> Subject: [JSP-INTEREST] Executing a unix commmand in jsp
>
>
> > Hi all,
> > Can anybody help me in telling how to execute a operating system
> command in a
> > jsp page. Thanks
> > Regards
> > Mihir
> >
> > horwat wrote:
> >
> > > A friend of mine, Greg Murray, created MightyJ, an IDE written in java.
> It
> > > is extendable through a plugin mechanism which allows plugins to be
> loaded
> > > manually or over the web. It currently has a search and zip viewer
> plugins
> > > which you may find useful.
> > >
> > > http://www.mightyj.com/
> > >
> > > Justy
> > >
> > > ----- Original Message -----
> > >
> > > > Does anyone know where I can get a tool that will search jars, zips,
> etc.
> > > > for a specific class file and it's directory...
> > > > _________________________________________________________________
> > > > Get your FREE download of MSN Explorer at http://explorer.msn.com
> > > >
> > > >
> > >
> ===========================================================================
�{.n�+���j)m�X��ǫ�6�j˧r����[�ܬ� �}�R<�SLZ+v(�ٚ�[h�+-��ڲ�ܢl"��w+���
��DD���I4���ޕ�ڞ�@B�'%#�I���lq��y�.�֭��i��ڽ�.��&���v�-����ڪf�m�������ڞ�(�
��;)�;)}���ia���0����&�8.���j��j�Z���v�x����i��0�8.��(��ົ�}��}��j���ڙ䞮�^�