Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eff.sc could not find "mvn" executable #2

Closed
mkotsbak opened this issue Jul 29, 2015 · 5 comments
Closed

Eff.sc could not find "mvn" executable #2

mkotsbak opened this issue Jul 29, 2015 · 5 comments

Comments

@mkotsbak
Copy link

$ scala ~/progs/mvn2sbt/Eff.sc .
You are called "scala Eff ."
Creating .\dependencyTree.txt.
Exception in thread "Thread-0" java.io.IOException: Cannot run program "mvn" (in
directory "."): CreateProcess error=2, The system cannot find the file specifie
d
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.sc
ala:69)
at scala.sys.process.ProcessImpl$PipedProcesses.runAndExitValue(ProcessI
mpl.scala:133)
at scala.sys.process.ProcessImpl$CompoundProcess$$anonfun$1.apply$mcV$sp
(ProcessImpl.scala:94)
at scala.sys.process.ProcessImpl$Spawn$$anon$1.run(ProcessImpl.scala:23)

Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
e file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 4 more
java.lang.RuntimeException: No exit code: process destroyed.
at scala.sys.process.ProcessImpl$CompoundProcess.exitValue(ProcessImpl.s
cala:88)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBui
lderImpl.scala:112)
at Main$$anon$1$$anonfun$1.apply(Eff.sc:40)

"mvn" is in the path:

$ which mvn
/c/apache-maven-3.2.3/bin/mvn

This is Cygwin (bundled with Git for windows)

@mkotsbak
Copy link
Author

Same happens in a windows cmd.exe console.

@mkotsbak
Copy link
Author

I found the cause (in http://stackoverflow.com/questions/6979155/cannot-run-scala-through-processbuilder).

It worked when i changed "mvn" to "mvn.bat". So to be portable it should either check the OS or if does not find "mvn" also try "mvn.bat".

ajozwik added a commit that referenced this issue Aug 12, 2015
@ajozwik
Copy link
Owner

ajozwik commented Aug 12, 2015

Please verify the solution.

@ajozwik ajozwik closed this as completed Aug 12, 2015
@mkotsbak
Copy link
Author

It does not, but neither my workaround to hardcode "mvn.bat", so I suppose something weired has happened to my PATH here, but it correctly detected to use "mvn.bat", so if it works in UNIX like systems too, I guess we could assume that the problem should be solved.

@ajozwik
Copy link
Owner

ajozwik commented Aug 18, 2015

Please write PR if you have more flexible solution. mvn command can be injected by argument. It depends on you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants