dcsimg
java.io.IOException: CreateProcess: ls error=2
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   anurag_kirpal
Posted On:   Tuesday, April 13, 2004 09:59 PM

I can not run the shell commands using Runtime.getRuntime().exec(ls).

It gives error like

java.io.IOException: CreateProcess: ls error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process. (Unknown Source)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at test1.main(test1.java:13)

Please help me

Re: java.io.IOException: CreateProcess: ls error=2

Posted By:   Sean_Owen  
Posted On:   Wednesday, April 14, 2004 03:29 PM

This means "file not found", basically. Probably you are trying to run some program by just running "foo.exe" instead of specifying its full location, like "C:arfoo.exe". Either that, or possibly you need to invoke the command using the Windows "cmd" shell so that it'll find the program in your path. Search the internet for more information.
About | Sitemap | Contact