CreateProcess error=87, The parameter is incorrect

Rakesh picture Rakesh · Aug 7, 2011 · Viewed 34.3k times · Source

While building with ant, I am getting the following error:

java.io.IOException: Cannot run program "D:\Tools\Java\jdk1.6.0_12\jre\bin\java.exe": (my Project & its path)Error: CreateProcess error=87, The parameter is incorrect

Any idea how to fix it?

Answer

Jason B-H picture Jason B-H · Oct 17, 2012

I received this error as well, but for different cases than what is listed. I get this when attempting to execute JUnit tests in an Eclipse project whose workspace path is too long; moving the project to a shorter path resolved this issue.

Cannot run program "C:\Program Files\Java\jdk1.6.0_26\jre\bin\java.exe": (Long Project Path Path)Error: CreateProcess error=87, The parameter is incorrect