Keep JAVA_OPTS for backwards compatibility.
There were three related problems: 1) The first argument was always parsed with read-string, even when defaulting to the :main namespace. This caused non-numeric first arguments to throw: Exception in thread "main" java.lang.Exception: Unable to resolve symbol: foo in this context Avoid read-string entirely and update the unit tests to use an unreadable string instead of a number to make the problem obvious. This problem was reported by Marek Kubica on the Clojure mailing list. 2) When using an alias the alias keyword was passed to -main as the first argument. This is inconsistent with how the -m and :main simply pass the program arguments, not the namespace or -m flag. 3) There was no way to pass "-m" or a string beginning with ":" as a first argument to the run program. Added "--" as an option to escape these.
When running lein commands from the root folder on windows (such as "C:\"), special care needs to be taken to escape the final backslash.
lein.bat would fail to run when installed into a folder whose path name contains parentheses (such as "Program Files (x86)").
This was breaking installs of things like org.clojars.trptcolin/libthrift (where the group ID had periods).
Relative paths are assumed to be relative to the root of the project.