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)
Wednesday, March 3, 2010
Subscribe to:
Post Comments (Atom)
1 comment:
didnt work too, give me a command failure message :(
Post a Comment