Wednesday, March 3, 2010

java.io.IOException: CreateProcess: ... error=193

When I tried running an executable from from Java Jar file, while executing following code -

Runtime.getRuntime().exec("C:\\maven\\apache-maven-2.2.1\\bin\\mvn pax:provision");

I got following Exception -

java.io.IOException: Cannot run program "C:\maven\apache-maven-2.2.1\bin\mvn": CreateProcess error=193, %1 is not a valid Win32 application

To resolve this problem, the command should be invoked as:

Runtime.getRuntime().exec("cmd.exe /C C:\\maven\\apache-maven-2.2.1\\bin\\mvn pax:provision");

And it worked.

(Running executable from Java Jar file)

1 comment:

Walaa said...

didnt work too, give me a command failure message :(