Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting the following error when I run mvn on OS X Mavericks: Cannot run program "/bin/sh": error=2, No such file or directory

Tags:

java

macos

maven

I am running OS X Mavericks on a MacBook Pro.

I have maven 3.0.5 installed.

When I run mvn, I am getting the following error message.

Error while executing process. Cannot run program "/bin/sh": error-2, No such file or directory

And before you ask:

PATH="/usr/local/apache-maven-3.0.5/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin:/usr/local/bin:/bin:/usr/bin"

M2_HOME="/usr/local/apache-maven-3.0.5"

M2="/usr/local/apache-maven-3.0.5/bin"

MAVEN_OPTS="-Xms256m -Xmx768m -XX:MaxPermSize=512m"

I am also seeing the following near the beginning of the mvn output: [WARNING] Some problems were encountered while building the effective settings

[WARNING] Failed to use environment variables for interpolation: Cannot run program "env": error=0, spawn failed @ 
like image 758
Craig Wright Avatar asked May 19 '15 15:05

Craig Wright


1 Answers

I had the same problem: exec() failed with ANY executable. Finally remembered that I was using a private jre. That jre was a copy of the original one, just with bin/java set as executable.

I made lib/jspawnhelper executable and it worked!

like image 131
Franco Catrin Avatar answered Oct 03 '22 00:10

Franco Catrin