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
lein fails on Windows 10 with 'CreateProcess error=206' when classpath too long #2452
Comments
As far as I understand this is a limitation of Java and the OS; I don't think there's anything Leiningen can do about hard-coded OS limitations? |
Definitely lein can't do anything about the command-line length limit. It might be possible to work around this though; for instance gradle has a https://tuhrig.de/gradles-bootrun-and-windows-command-length-limit/ I suppose this might be better handled by a plugin or something, though it seems a little odd to require a plugin just to run a complex project on Windows. EDIT: some more discussion from the gradle project here: gradle/gradle#1989 |
So what should be solution for this case? Should long classpath handling be delegated to plugin or to leiningen-core. This is general Java problem and mostly it is development stage problem. Final artifacts be it jar or war almost always have classpath inside and not passed from command line. |
FWIW, I've developed a fix for this in tools.deps.alpha here: https://dev.clojure.org/jira/browse/TDEPS-120 The actual code needed to create a pathing jar is not terribly complex, and this shouldn't be too hard to implement in leiningen. I will give it a look when I've got more time. |
Ok, well it's early days yet but I wrote this plugin which seems to fix the problem by putting a hook around https://github.com/timgilbert/lein-classpath-jar This is a sufficient workaround for me, at least, so I'm going to mark this issue as closed for now. |
Has anyone tried "Enable Win32 long paths" setting in policy editor in Windows 10? (described here) |
I'm trying to run a fairly complex project with a lot of dependencies from leiningen 2.8.1 and JDK 1.8.0_172 on Windows 10, and I believe I'm hitting this Windows error.
lein run
just tells meThe system cannot execute the specified program
, but when Ilein repl
I get this:I think the root of the problem is that the number of jars on my classpath causes the
java
command-line to exceed its length of 32K characters:I am able to work around this problem for now by compiling an uberjar and executing that - the uberjar essentially acts as a "pathing jar" as described in the above StackOverflow answer. Still, it would be nice if lein itself had some way to work around this problem so I wasn't needing to compile code all the time.
The text was updated successfully, but these errors were encountered: